Help to identify the problem with the code

Hi! I am new to dynare. I am trying to replicate Sahminan et al. (2017). But am getting a message:
Starting preprocessing of the model file …
Found 16 equation(s).
Evaluating expressions…done
Computing static model derivatives:

  • order 1
    Computing dynamic model derivatives:
  • order 1
  • order 2
    Processing outputs …
    Preprocessing completed.


c 0
piH 0
mc 0
kg 0
s 0
i 0
y 0
n 0
nx 0
gI 0
gc 0
pH 0
pi 0
p 0
e 0
a 0

Modulus Real Imaginary

     1.8e-16          1.8e-16                0
      0.3436           0.3436                0
        0.75             0.75                0
        0.75             0.75                0
       0.975            0.975                0
           1                1                0
           1                1                0
           1                1                0
           1                1                0
       1.274            1.274          0
       1.731            1.731          0


There are 2 eigenvalue(s) larger than 1 in modulus
for 2 forward-looking variable(s)
Where am I going wrong?
Thank you in advance.

trial2004.mod (1.6 KB)

Which problem are you facing? Your mod-file seems to run without any issues.

Thanks for the reply. The problem that I am facing is: the same mod file does not work when I use a bayesian estimation technique. Attaching the mod and the data file.

Thanks in advance.

trial2304.mod (1.9 KB)
data.mat (111.7 KB)

  1. See
  1. Similarly,

Use model-local variables, i.e. the ones with the pound operator.

Thanks for the reply. My model worked with the diffuse_filter included in estimation-command.
However, there are two queries that I have:

  1. If variables in the model are measured as deviation from constant steady state - should my varobs y included in datafile be measured as logY-logYsteady?
  2. i am getting the following:
    Posterior mean variance decomposition (in percent)
    cstar pistar epsiloni epsilon1 epsilon2 epsilon3
    y NaN NaN NaN NaN NaN NaN
    c NaN NaN NaN NaN NaN NaN
    How do In solve this?
    data1.mat (853 Bytes)
    trial2304.mod (1.9 KB)

Thanking you in advance.

  1. You are not listening. You are still not handling parameter dependence correctly. kappa must be a model-local variable. Otherwise theta will not be identified.
  2. You need to make sure the model variables and the data treatment are consistent. There are various ways to do this. Please refer to Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models”
  3. Due to your unit roots, the unconditional variance is infinite. You cannot decompose infinity.

Thanks Prof. Pfeifer for the reply. Have helped me to refine and run my model. Also many thanks for sharing the link to the Guide document. It will be an extremely helpful read.



Dear Prof. Pfeifer,

As per your inputs I refined my model and it worked fine except that I am getting a message as below:
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 1.438951e-21.
Also the value for output post the two shocks (y_epsilon2 & y_epsilon3) are widely different. As per other similar papers they are very close (a difference of -0.02). Could this be due to the error reported in the message above?
Please find attached my mod file and the data set.
Thanking you for you time and inputs in advance.
SL2904.mod (1.8 KB)
datasl.mat (701 Bytes)

  1. Again, check identification. Not all your estimated parameters are identified.
  2. Plot your data. You will see that there is still a trend and that there is an unhandled seasonal pattern at the end.