model_diagnostics

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

model_diagnostics

Postby boskar » Tue Oct 04, 2011 9:49 am

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?
boskar
 
Posts: 6
Joined: Tue Oct 04, 2011 9:31 am
Location: Rennes, France

Re: model_diagnostics

Postby boskar » Tue Oct 11, 2011 2:24 pm

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)

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
boskar
 
Posts: 6
Joined: Tue Oct 04, 2011 9:31 am
Location: Rennes, France

Re: model_diagnostics

Postby SébastienVillemot » Thu Oct 27, 2011 3:13 pm

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

Best,
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France

Re: model_diagnostics

Postby boskar » Sun Apr 22, 2012 4:33 pm

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.
boskar
 
Posts: 6
Joined: Tue Oct 04, 2011 9:31 am
Location: Rennes, France

Re: model_diagnostics need for help

Postby ericlearndynare » Fri Jun 08, 2012 9:07 am

boskar wrote: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
ericlearndynare
 
Posts: 6
Joined: Tue Mar 30, 2010 1:31 pm

Re: model_diagnostics

Postby jpfeifer » Fri Jun 08, 2012 9:24 am

After running the mod-file, just type
Code: Select all
model_diagnostics(M_,options_,oo_)

into Matlab
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: model_diagnostics

Postby ericlearndynare » Fri Jun 08, 2012 11:12 am

jpfeifer wrote:After running the mod-file, just type
Code: Select all
model_diagnostics(M_,options_,oo_)

into Matlab


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);
ericlearndynare
 
Posts: 6
Joined: Tue Mar 30, 2010 1:31 pm

Re: model_diagnostics

Postby jpfeifer » Fri Jun 08, 2012 11:35 am

Did you put
Code: Select all
steady;
check;

into your mod-file?
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: model_diagnostics

Postby ericlearndynare » Fri Jun 08, 2012 11:43 am

jpfeifer wrote:Did you put
Code: Select all
steady;
check;

into your mod-file?


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.
ericlearndynare
 
Posts: 6
Joined: Tue Mar 30, 2010 1:31 pm

Re: model_diagnostics

Postby jpfeifer » Sat Jun 09, 2012 9:02 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: model_diagnostics

Postby Oriana » Fri Sep 18, 2015 11:04 am

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?
Oriana
 
Posts: 67
Joined: Fri Jul 18, 2014 2:49 pm

Re: model_diagnostics

Postby jpfeifer » Mon Sep 21, 2015 6:53 am

Those are warnings that can occur in big models. Is there anything suspicious about the results?
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: model_diagnostics

Postby superztt » Mon Mar 07, 2016 4:31 am

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.
superztt
 
Posts: 58
Joined: Sat Apr 26, 2014 8:24 pm

Re: model_diagnostics

Postby jpfeifer » Mon Mar 07, 2016 8:24 am

It means that nothing obvious turned up during the diagnostics.

Usually when the BK conditions fail, it is a timing error.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 12 guests