Problem with theoretical moments in Dynare 4.1.2

I face the following problem when using Dynare 4.1.2 to solve a stochastic linearized model and want to print out the theoretical moments:

In the attached mod-file US_OW98_original, the standard deviations of the innovations are expressed in percent/100. For the purpose of model comparison, an additional set of endogenous variables (labeled interest, inflation, inflationq,…) is defined as 100x the original corresponding model variable, respectively. Running this file, the theoretical moments of interest, inflation, inflationq are declared as NaNs, even so the theoretical moments for the original model variables representing the interest rate and so on are printed out.

Now, using the same file but multiplying the variances of the innovations in the shocks section by 10000 and deleting the 100x in the definition of the additional variables, I receive the theoretical moments of these variables (interest, inflation, inflationq). I have attached this case in the mod-file US_OW98.

Can you help me why the first procedure is not working? (I have to deal with more elaborated models in which the second procedure would be difficult to implement.).

Thanks & kind regards,
US_OW98.mod (6.06 KB)
US_OW98_original.mod (5.94 KB)

maybe your Dynare 4.1.2 is installed wrong.
I run your code,it works very well,and both can caculates the moments!

Dear Maurice,
thanks for your reply. Various colleagues have tried the US_OW98_original file and all face the same problem. Do I understand correctly that you indeed receive also the moments for the variables * interest, inflation * and *inflationq * when running US_OW98_original in Dynare 4? (For the other variables we receive the theoretical moments.)? If so, may I ask you which Matlab version you have used?


First, variables whose mean/variance appear as NaN are variables that are detected as having a unit root. Indeed, your model has a unit root, as shown in the list of eigenvalues.

Second, in the first version of the MOD file, Dynare detects “rff” as being stationnary, while “interest” is detected as being non-stationary, while the two only differ by a 100 factor. My understanding is that the discrepancy comes from the numerical tolerance of the algorithm used to discriminate between stationary and non-stationary variable (implemented in th_autocovariances.m). If you lower the threshold, then it works fine. Concretely, if you add:

options_.Schur_vec_tol = 1e-6;

in your first MOD file, then it behaves like the second one.

I think this fixes your problem but be careful, you may have other problems of the same kind since you are playing with variables having a very small variance. The second procedure is better in this respect.


1 Like

Indeed, since the model defines for instance explicitly the price level, which is not stationary under a wide range of monetary policy prescriptions I expected not all variables to be stationary. The question arised because of the results for the original inflation, interest variables on the one hand and those for the rescaled variables on the other hand.
Thanks a lot for the explanation for this discrepancy and how to circumvent it. Whenever possible I’ll try to use the 2nd option as recommended!