Bringing model to the data

Good day Prof I am a new user of Dynare. I have already finished the colding for my thesis. I am left with taking data into matlab. Please help sir on how I will take in the data.

Please first read Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models”

Good day Prof. Thanks for your timely response to our challenges. As I have told you earlier I am a new user of Dynare using DSGE for my thesis. I am done with the model coding and I am trying to run my model to get the steady state but got the following error message. Your timely help would be appreciate sir. The errors message are as follow:

STEADY: The Jacobian contains Inf or NaN. The problem arises from:

STEADY: Derivative of Equation 7 with respect to Variable h (initial value of h: 0.797)
STEADY: Derivative of Equation 8 with respect to Variable k (initial value of k: 0.137)
STEADY: Derivative of Equation 7 with respect to Variable y (initial value of y: 0)
STEADY: Derivative of Equation 8 with respect to Variable y (initial value of y: 0)
STEADY: Derivative of Equation 11 with respect to Variable pi (initial value of pi: 0.062)
STEADY: Derivative of Equation 11 with respect to Variable n (initial value of n: 0)

STEADY: The problem most often occurs, because a variable with
STEADY: exponent smaller than 1 has been initialized to 0. Taking the derivative
STEADY: and evaluating it at the steady state then results in a division by 0.
Error using dynare_solve (line 60)
An element of the Jacobian is not finite or NaN

Error in evaluate_steady_state (line 66)
[ys,check] = dynare_solve([M.fname ‘_static’],…

Error in steady_ (line 54)
[steady_state,params,info] = evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck);

Error in steady (line 81)
[steady_state,M_.params,info] = steady_(M_,options_,oo_);

Error in practise (line 296)
steady;

Error in dynare (line 180)
evalin(‘base’,fname) ;

Dear Prof, kindly help me. I got this errors again after I initialized a parameter I forgot to initialize.
STEADY: The Jacobian contains Inf or NaN. The problem arises from:

STEADY: Derivative of Equation 11 with respect to Variable n (initial value of n: 0)

STEADY: The problem most often occurs, because a variable with
STEADY: exponent smaller than 1 has been initialized to 0. Taking the derivative
STEADY: and evaluating it at the steady state then results in a division by 0.
Error using dynare_solve (line 60)
An element of the Jacobian is not finite or NaN

Error in evaluate_steady_state (line 66)
[ys,check] = dynare_solve([M.fname ‘_static’],…

Error in steady_ (line 54)
[steady_state,params,info] = evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck);

Error in steady (line 81)
[steady_state,M_.params,info] = steady_(M_,options_,oo_);

Error in practise (line 298)
steady;

Error in dynare (line 180)
evalin(‘base’,fname) ;

  1. Please do not cross-post
  2. As the message says: you initialized n=0, but that is not allowed in your model for some reason. Without the file, it is impossible to tell.

Thank you prof for your response and correction. I went through the model again and effected the necessary correction. However, I still got the following error message sir. STEADY: The Jacobian contains Inf or NaN. The problem arises from:
STEADY: Derivative of Equation 11 with respect to Variable n (initial value of n: 0)
STEADY: Derivative of Equation 19 with respect to Variable F (initial value of F: 0)
STEADY: Derivative of Equation 19 with respect to Variable Z (initial value of Z: 0)

STEADY: The problem most often occurs, because a variable with
STEADY: exponent smaller than 1 has been initialized to 0. Taking the derivative
STEADY: and evaluating it at the steady state then results in a division by 0.
Error using dynare_solve (line 60)
An element of the Jacobian is not finite or NaN

Error in evaluate_steady_state (line 66)
[ys,check] = dynare_solve([M.fname ‘_static’],…

Error in steady_ (line 54)
[steady_state,params,info] = evaluate_steady_state(oo_.steady_state,M_,options_,oo_,~options_.steadystate.nocheck);

Error in steady (line 81)
[steady_state,M_.params,info] = steady_(M_,options_,oo_);

Error in practise (line 298)
steady;

Error in dynare (line 180)
evalin(‘base’,fname) ;
The updated model file is hereby attached for your timely help and assistance sir. Many thanks Prof!Practise.mod (2.3 KB)

As I wrote before, you did not initialize n (nor F or Z) in the initval block.

Thank you Prof. I have initialized n F and Z as advised. I however obtained the below error message and would appreciate your timely assistance on what to do. Thanks

SOLVE: Iteration 6
Spurious convergence.
0.6240
0.1210
-1.3712
0.4820
0.1749
0
0.6222
0.0191
-0.0072
0
0.0620
0.0660
0.2030
0.1920
0.1210
0
0
0.8000
0
1.8000
1.2000
1.1000
0.7000
0.8600
0
0

Residuals of the static equations:

Equation number 1 : -0.00056678
Equation number 2 : -20.2736
Equation number 3 : -0.35525
Equation number 4 : -15.7261
Equation number 5 : 0.042668
Equation number 6 : 0.62759
Equation number 7 : 0.62223
Equation number 8 : 0.019144
Equation number 9 : 0.011603
Equation number 10 : -0.81982
Equation number 11 : -0.00081761
Equation number 12 : -0.063144
Equation number 13 : -7.8119
Equation number 14 : 0.43589
Equation number 15 : 1.9516
Equation number 16 : -0.192
Equation number 17 : -0.121
Equation number 18 : -0.62194
Equation number 19 : -1.2468
Equation number 20 : 0.8
Equation number 21 : 1.2
Equation number 22 : 1.1
Equation number 23 : 0.44681
Equation number 24 : 0.28088
Equation number 25 : 0
Equation number 26 : 0

Error using print_info (line 74)
Impossible to find the steady state. Either the model doesn’t have a steady state, there are an infinity of steady
states, or the guess values are too far from the solution

Error in steady (line 92)
print_info(info,options_.noprint, options_);

Error in practise (line 301)
steady;

Error in dynare (line 180)
evalin(‘base’,fname) ;

Please provide the most recent version of the file.

Thank you Prof for your assistance. The latest version of file is attached.Practise.mod (2.4 KB)

I would appreciate your timely help and assistance sir.

  1. Recheck all equations.
  2. Provide sensible starting values.
STE-(rho_a*STE(-1)+ epsilon_a)=0;

clearly has steady state STE=0.

Thank you Prof! I am rechecking all the equations and would get back to you. However, what should guide the choice of the sensible starting values. Many thanks sir. I would also appreciate if you can provide me with any model-file on fiscal and monetary policy interaction or interdependence sir. Many thanks sir.

  1. As indicated in my previous post, for some equations it is straightforward to compute the steady state as the equations are independent of the other ones. Other values are guided by economic intuition. For example, consumption cannot be negative and must be smaller than output.
  2. As also indicated before, I don’t have such a model.

Good day prof. I have a very quick and important question sir. How would I copy impulse response graphs from dynare/matlab to Microsoft word sir. Thank you very much sir for timely response sir.