Dynare version (4.4.3) run a model

I wrote my code , when I want to run my programme dynare version 4.4.3 says :
Starting Dynare (version 4.4.3).
Starting preprocessing of the model file …
Found 33 equation(s).
Evaluating expressions…done
Computing static model derivatives:

  • order 1
  • order 2
  • derivatives of Jacobian/Hessian w.r. to parameters
    Computing dynamic model derivatives:
  • order 1
  • order 2
  • derivatives of Jacobian/Hessian w.r. to parameters
    Processing outputs …done
    Preprocessing completed.
    Starting MATLAB/Octave computing.

I was waiting to run model but it dosen`t do anything else, what shoud I do?
please helo me.

Thanks a lot.

Please provide the file. Does Matlab still report to be busy?

1 Like

Dear Johannes Pfeifer

I use Matlab version R2011a for running my codes, first from file menu I set path and add folder (c:\dynare\4.4.3\matlab…) and then run codes but it still busy. I appreciate it if you can help me.

please check the attach file.

Best regard,
Mohsen.
phd1.mod (9.4 KB)
data_phd1.mat (9.0 KB)

You are not using proper assignments.
(c/y)=0.468565321;
is not valid code, because c/y is not a proper variable name.

1 Like

Dear Johannes Pfeife

c/y is not a variable name, as you know i gave the number of parameter y and I wanna to compute number of parameter c,anyway, I also changed it and wrote c=175853.0745 or m=752785.937, but it still did not work.

can you explain more.

Best Regards,
Mohsen.
phd1.mod (9.4 KB)

Again, Matlab assignments can only have one variable on the left hand side.
((tetha_f-1)/(tetha_f))=1.2;
is not an assignment, but rather an equation. That’s not how this works.

1 Like

Dear Professor Johannes Pfeife

I changed all assignments but matlab still busy. I do not know why?

Best Regard,
Mohsen

phd1.mod (9.4 KB)

((c/y)*(1+((3/2)*eps_m*((c/m)^2)))+(inv/y)+(g/y)+((b_m*(phi_m/2))+(b_l*(phi_l/2)))) = 1;

is still no valid Matlab code

1 Like

Dear Professor Johannes Pfeife

Thanks for guiding me to change the variables to matlab assignments, after changing matlab runs the codes but it says:
Starting Dynare (version 4.4.3).
Starting preprocessing of the model file …
Found 33 equation(s).
Evaluating expressions…done
Computing static model derivatives:

  • order 1
    Computing dynamic model derivatives:
  • order 1
  • order 2
    Processing outputs …done
    Preprocessing completed.
    Starting MATLAB/Octave computing.

You did not declare endogenous variables after the estimation/calib_smoother command.

Prior distribution for parameter alpha_m has two modes!
and also for variables like h clamda psi_cap … that i want to compute them base on other variables,these variables are not computed by matlab (it says NaN for them).

Thanks a lot,
Best regard,
Mohsen.

phd1.mod (9.4 KB)

Dear Professor Johannes Pfeife

I calibrated some parameters in preamble and right now it does not have any problems in that part but when i want to identify program (identification command) it says:

Starting Dynare (version 4.4.3).
Starting preprocessing of the model file …
Found 33 equation(s).
Evaluating expressions…done
Computing static model derivatives:

  • order 1
  • order 2
  • derivatives of Jacobian/Hessian w.r. to parameters
    Computing dynamic model derivatives:
  • order 1
  • order 2
  • derivatives of Jacobian/Hessian w.r. to parameters
    Processing outputs …done
    Preprocessing completed.
    Starting MATLAB/Octave computing.

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

STEADY: Derivative of Equation 18 with respect to Variable y_hat (initial value of y_hat: 0)
STEADY: Derivative of Equation 2 with respect to Variable w_hat (initial value of w_hat: 0)
STEADY: Derivative of Equation 9 with respect to Variable e_h (initial value of e_h: 0)
STEADY: Derivative of Equation 2 with respect to Variable inf_c (initial value of inf_c: 0)
STEADY: Derivative of Equation 11 with respect to Variable inf_c (initial value of inf_c: 0)
STEADY: Derivative of Equation 18 with respect to Variable inf_c (initial value of inf_c: 0)
STEADY: Derivative of Equation 2 with respect to Variable inf_star (initial value of inf_star: 0)
STEADY: Derivative of Equation 11 with respect to Variable inf_star (initial value of inf_star: 0)
STEADY: Derivative of Equation 18 with respect to Variable inf_star (initial value of inf_star: 0)
STEADY: Derivative of Equation 32 with respect to Variable inf_star (initial value of inf_star: 0)
STEADY: Derivative of Equation 3 with respect to Variable m_hat (initial value of m_hat: 0)
STEADY: Derivative of Equation 5 with respect to Variable m_hat (initial value of m_hat: 0)
STEADY: Derivative of Equation 6 with respect to Variable m_hat (initial value of m_hat: 0)
STEADY: Derivative of Equation 18 with respect to Variable r_shat (initial value of r_shat: 0)
STEADY: Derivative of Equation 3 with respect to Variable b_mhat (initial value of b_mhat: 0)
STEADY: Derivative of Equation 5 with respect to Variable b_mhat (initial value of b_mhat: 0)
STEADY: Derivative of Equation 29 with respect to Variable b_mhat (initial value of b_mhat: 0)
STEADY: Derivative of Equation 3 with respect to Variable b_lhat (initial value of b_lhat: 0)
STEADY: Derivative of Equation 6 with respect to Variable b_lhat (initial value of b_lhat: 0)
STEADY: Derivative of Equation 30 with respect to Variable b_lhat (initial value of b_lhat: 0)
STEADY: Derivative of Equation 2 with respect to Variable lamda_hat (initial value of lamda_hat: 0)
STEADY: Derivative of Equation 9 with respect to Variable l_hat (initial value of l_hat: 0)
STEADY: Derivative of Equation 31 with respect to Variable g_hat (initial value of g_hat: 0)
STEADY: Derivative of Equation 23 with respect to Variable eps_mhat (initial value of eps_mhat: 0)
STEADY: Derivative of Equation 24 with respect to Variable eps_lhat (initial value of eps_lhat: 0)
STEADY: Derivative of Equation 25 with respect to Variable eps_ihat (initial value of eps_ihat: 0)
STEADY: Derivative of Equation 26 with respect to Variable eps_ahat (initial value of eps_ahat: 0)
STEADY: Derivative of Equation 33 with respect to Variable eps_rhat (initial value of eps_rhat: 0)
STEADY: Derivative of Equation 27 with respect to Variable eps_what (initial value of eps_what: 0)
STEADY: Derivative of Equation 28 with respect to Variable eps_phat (initial value of eps_phat: 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.

Thanks a lot,
Mohsen.

phd1.mod (9.4 KB)

Check all model equations. Your model seems to be linearized, but e.g.

log(eps_lhat) = ((rho_l*log(eps_lhat(-1)))+v_l);

is clearly not linear and cannot work with the default initial value of 0 for computing steady states.

1 Like

Dear Professor Jpfeifer

Thanks for helping me, I changed some equations and again run my codes but it still says:

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

STEADY: Derivative of Equation 1 with respect to Variable c_hat (initial value of c_hat: 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.

I do not know what should I do with equation 1, I think it is linear,
I also used
Paolo Zagaglia workpaper for wrote codes.
forcasting term sructure dsge.pdf (877.3 KB)
phd1.mod (9.8 KB)

Best regard,
Mohsen.

Your first equation contains

(1-csigma)^(-(1/csigma)-(1))

But 1-csigma is 0, resulting in Inf

1 Like

Dear Professor Pfeifer
I checked all model equations several times and changed at least thirty times some amount of parameters at preamble, once I run codes with dynare_sensitivity command, it starts running MC iteration but it does not say you have an unique saddle path.
I also run codes with identification command it says:
Parameter error:
The model does not solve for prior_mean with error code info = 20

info==20 %! Cannot find the steady state, info(2) contains the sum of square residuals (of the static equations).

phd1.mod (9.3 KB)
dataphd1.mat (9.9 KB)

Is it possible the model equations were changed at working paper, I appreciate it for helping me.

Best regard,
Amir

The two equations

tetha_lhat = (tetha_l+eps_what);
tetha_fhat = (tetha_f+eps_phat);

contain constant terms, but the other equations rely on the all variables being mean 0.

1 Like

Dear Professor Jpfeifer

In the Loglinearization equations of the working paper there are 31 equations and 33 endogenous variables, there are two shock equations for eps_what and eps_phat but i could not find any equation in model with these variables , i add those two variables on my own because i need 33 equatuions.
please help me i do not know what should i do?
Best regard,
Amir
forcasting term sructure dsge.pdf (881.1 KB)

Dear Professor Jpfeifer

I changed these equations whit uhlig method then I run identification, it says:
Parameter error:
The model does not solve for prior_mean with error code info = 2

info==2 %! MJDGGES returned an error code.

then I run model_diagnostics, it says:
model_diagnostic: the Jacobian of the static model is singular
there is 1 colinear relationships between the variables and the equations
Colinear variables:
b_shat
tau_hat
tax_lshat
h_hat
Colinear equations
Columns 1 through 19

 1     2     3     4     7     8    10    11    12    13    14    18    19    20    21    22    23    24    25

Columns 20 through 27

26    27    28    29    30    31    32    33

The presence of a singularity problem typically indicates that there is one
redundant equation entered in the model block, while another non-redundant equation
is missing. The problem often derives from Walras Law.

I removed some equations with those variables but nothing happen.

I do not know what should i do?

please help me.

Best regard,
Amir.
phd1.mod (9.5 KB)
dataphd1.mat (9.9 KB)

Check all your equations. Ideally, start from a simpler version of the model that works.

Dear Professor Jpfeifer

After some changes in model equations, There is not any problem with the model right now.
when i run dynare_sensitivity command it says:

29.4% of the prior support gives unique saddle-path solution.
59.3% of the prior support gives explosive dynamics.
10.6% of the prior support gives indeterminacy.
For 0.6% of the prior support dynare could not find a solution.
For 0.0% The steady has NaNs.
Smirnov statistics in driving unique solution
Parameter d-stat p-value
phi_k 0.389 0.000
alpha_y 0.379 0.000
No correlation term with pvalue <1e-05 and |corr. coef.| >0 found for unique Stable Saddle-Path
Smirnov statistics in driving indeterminacy
Parameter d-stat p-value
phi_k 0.338 0.000
alpha_r 0.221 0.000
gamma_p 0.178 0.000
cgamma 0.151 0.000
csigma 0.145 0.000
alpha_y 0.140 0.001
No correlation term with pvalue <1e-05 and |corr. coef.| >0 found for NO indeterminacy
Smirnov statistics in driving instability
Parameter d-stat p-value
phi_k 0.470 0.000
alpha_y 0.382 0.000
gamma_p 0.122 0.000
alpha_r 0.116 0.000
csigma 0.109 0.000
cgamma 0.109 0.000
Smirnov statistics in driving inability to find a solution
Parameter d-stat p-value
csigma 0.602 0.000
No correlation term with pvalue <1e-05 and |corr. coef.| >0 found for NO inability to find a solution
No correlation term with pvalue <1e-05 and |corr. coef.| >0 found for inability to find a solution

more than hundred times I changed parameters value, but the percentage of unique saddle path only change some percentage.

I do not know why I could not find the unique saddle path?

thanks a lot for helping me.

Best Regard,
Amir Mohsen.
data_phd1.mat (10.8 KB)
phd.mod (9.1 KB)