When solving a model in dynare for the ramsey policy, the model is solved and policy and transitions functions are computed (at least for the variables I asked for). However, it does not solve for the Theoretical moments. Does anyone have an idea obout why - i attached the associated file ?

When trying to find the mistake in stationarizing, I am trying to find out to which economic variable (or lagrange multiplier) the unit root corresponds to. When running the file I find that it is the 21’st eigenvalue in oo_.dr.eigval that is problematic. That corresponds either to a economic variable (that might not be stationarized properly) or a Lagrange multiplier (in front of some constraint where the problem might lie). However, it is not fully clear to me how to find that variable using the M_ and the oo_ structures (I haven’t been able to locate a full description what is in these).

I have tried to do this using the oo_.dr.order_var that I guess gives the reordering of the variables used by dynare where I guess that the original ordering first counts the variables as they are stated and then the multipliers of the constraints in the order the equations appear in the mode file as follows in the file :

1 - chi_1
2 - chi_2

(these are the first var declared as follows

@#for i in 1:(J-1)
var chi_@{i};
@#endfor)

and so on until the last endogeneous variable is declared (var a;)

42 - a

Then the exogeneous variable is declared (varexo ea;)

43 - ea

and then all the constraints

44 - lagrange multiplier corresponding to the first model equation : tot_ecost =…

45 - lagrange multiplier corresponding to the second model equation :
1=
@#for i in 1:J
+omega_@{i}*(p_@{i}^(1-epsilon)) endfor
;

46 - lagrange multiplier corresponding …

and so on in the order the equation appear in the model file (Am I correct in assuming that this is the original ordering?).

One way to find the problematic variable or constraint is then to use oo_.dr.order_var. However, this contains all variables in the model, while oo_.dr.eigval correspond to the state variables(?). To find out which variable that causes the problem I need to find out how oo_.dr.eigval appear in oo_.dr.order_var. This is not clear to me, though. Are these stacked first or last in oo_.dr.order_var or in some other way?

Alternatively, is there some other way to find out which economic variable or constraint that corresponds to the 21’st eigenvalue?

You can find general information on the ordering of variables in the Reference Manual, in the section about “Stochastic solution and simulation”.

In order to link eigenvalues to variables, you need to understand how the generalized schur decomposition is applied. You can have a look at the “dr.pdf” file (section 4.1) which comes in Dynare and which describes precisely how this decomposition is done. However, the actual implementation may differ a little bit from this document, so in the last analysis, you may need to go through the source of dr1.m to figure this out.