How to use this function: **model_diagnostics(M_,options_,oo_)** to see displayed statements about for example colinearities in my model equations?

I run my loglinearized model with stoch_simul and get some error messages about not satisfying the Blanchard-Kahn condition. I would like to investigate what is the reason of this problem. The nonlinear version of the model works well. So I don’t understand what can be wrong with the loglinearized version (all steady state values of variables set to 0, steady state parameters provided from steady state computation wich works for the nonlinear model, number of forward-looking variables is 6 and is consistent with nonlinear version, but number of eigenvalues bigger in modulus than one is now 11 instead of 6).

Is it possible to get more information about model behaviour/properties with **model_diagnostics**?

Anybody ?

I have corrected my equations and now I have in the log-linearized version 7 eigenvalues larger in modulus than one. So there is some progress. But this still doesn’t fit the number of anticipated variables which is 6. Here I give eigenvalues of both versions of the model: nonlinear and linear.

**nonlinear:**

EIGENVALUES:

Modulus Real Imaginary

7.077e-017 -7.077e-017 0

1.207e-015 -1.207e-015 0

0.5 0.5 0

0.5 0.5 0

0.5 0.5 0

0.5 0.5 0

0.5 0.5 0

0.5 0.5 0

0.5 0.5 0

0.5 0.5 0

0.83 0.83 0

0.83 0.83 0

0.9567 0.9567 0

0.9711 0.9711 0

1.058 1.058 0

1.108 1.108 0

Inf Inf 0

Inf Inf 0

Inf Inf 0

Inf Inf 0

There are 6 eigenvalue(s) larger than 1 in modulus

for 6 forward-looking variable(s)

The rank condition is verified.

**linear:**

EIGENVALUES:

Modulus Real Imaginary

4.542e-018 4.542e-018 0

6.718e-017 -6.718e-017 0

0.5 0.5 0

0.5 0.5 0

0.5 0.5 0

0.5 0.5 0

0.5 0.5 0

0.5 0.5 0

0.5 0.5 0

0.5 0.5 0

0.83 0.83 0

0.83 0.83 0

0.9567 0.9567 0

**1.012 1.012 0.02744
1.012 1.012 -0.02744**

1.058 1.058 0

Inf Inf 0

Inf Inf 0

Inf Inf 0

Inf Inf 0

**There are 7 eigenvalue(s) larger than 1 in modulus**

for 6 forward-looking variable(s)

for 6 forward-looking variable(s)

The rank conditions ISN’T verified!

I know the way of proceeding in such cases - checking staedy state, timing of variables, model equations, simplifying, checking parameters’ values. But I would like to know if there is some tricky way of detecting the source of problem. If there is for example the way of making some diadnostics of the model (the model is just stochstically simulated here).

And another question. What is the reason of occuring the complex eigenvalue? Maybe this would help me to find the reason of the problem with the lack of stable solution.

Any answers, comments, clues will be kindly seen

Karolina

model_diagnostics is a command under development and not yet officially released. This is the reason why there is no documentation.

Best,

After executing a file with a model by /dynare modelfile_name/ write directly in the command window: /model_diagnostics(M_, options_, oo_)/. It can give some useful information. For example how many colinerities there is in the model.

Excuse me, but can anyone please show how to execute the model_diagnostics function? Let’s say the mod. file is called “a.mod”, endo_nbr = 68,maximum_lag = 1,maximum_lead = 1

How to run it ? Any response is much appreciated. Thanks!

Eric

After running the mod-file, just type

into Matlab

[quote=“jpfeifer”]After running the mod-file, just type

into Matlab[/quote]

This followsing is what i got, i don’t know what’s wrong

model_diagnostics(M_,options_,oo_)

??? Error using ==> svd

Input to SVD must not contain NaN or Inf.

Error in ==> rank at 15

s = svd(A);

Error in ==> model_diagnostics at 131

rank_jacob = rank(jacob);

Did you put

```
steady;
check;
```

into your mod-file?

[quote=“jpfeifer”]Did you put

```
steady;
check;
```

into your mod-file?[/quote]

I am totally a beginner in Dynare, is it still necessary to put in “check”/“steady” in the codes, cause it’s already linearized and the steady has been solved by hand.

You should always put it there to let Dynare check if your computations are correct. I would guess your error message results from a mistake in computing the steady state/uninitialized parameters.

Dear all,

I got the following message:

Estimation::mcmc: Posterior (dsge) IRFs…

Estimation::mcmc: Posterior IRFs, done!

Warning: Matrix is singular to working precision.

In missing_DiffuseKalmanSmootherH3_Z at 257

In DsgeSmoother at 236

In dynare_estimation_1 at 504

In dynare_estimation at 92

In nonlinearomega at 2209

In dynare at 223

Prior distribution for parameter c1rhomuc has two modes!

Prior distribution for parameter c1rhoomegacm1 has two modes!

Warning: Range cannot be used in ‘basic’ mode. The entire

sheet will be loaded.

In xlsread at 199

In load_xls_file_data at 77

In dseries.dseries at 131

In makedataset at 103

In dynare_estimation_init at 531

In evaluate_smoother at 54

In shock_decomposition at 60

In nonlinearomega at 2222

In dynare at 223

Warning: Matrix is singular to working precision.

In missing_DiffuseKalmanSmootherH3_Z at 257

In DsgeSmoother at 236

In evaluate_smoother at 90

In shock_decomposition at 60

In nonlinearomega at 2222

In dynare at 223

Total computing time : 6h11m10s

Note: warning(s) encountered in MATLAB/Octave code

Your MATLAB session has timed out. All license keys have been returned.model_diagnostics(M_,options_,oo_)

MODEL_DIAGNOSTICS: No obvious problems with this mod-file were detected.

Accordingly to the model diagnostic command there are no obvious problems. I also selected steady and check in my mode file. Can I rely on my results?

Those are warnings that can occur in big models. Is there anything suspicious about the results?

What does it mean if there is nothing returned after I type in model_diagnostics(M_,options_,oo_)? Btw, I wanted to figure out why BK condition doesn’t hold in my model.

It means that nothing obvious turned up during the diagnostics.

Usually when the BK conditions fail, it is a timing error.