Relationship between eigenvalues and vars

Hi !

I have programmed up a model in Dynare to solve for the ramsey policy, but there is a mistake in stationarizing - there is a unit root (that can be found in oo_.dr.eigval).

When trying to find the mistake in stationarizing, I am trying to find out to which, if any, economic variable (or lagrange multiplier associated with the ramsey policy) 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.

Does this eigenvalue correspond to an economic variable declared by the var command (that might not be stationarized properly) or a Lagrange multiplier (in front of some constraint where the problem might lie) or does in correspond to some transformation of variables?

If the eigenvalue is either associated directly with one of the economic variables or lagrange multipliers, it would probably be easy to identify the problem in the model if I know what variable or constraint the problem is associated with, while it is probably more difficult in the last case. (In the simple model attached, the problem is probably easy to solve anyway, but I have also encountered the problem in larger models, where it is very time consuming to go over the entire model again without having an idea where the problem lies - to have a hunch where the problem lies would help a lot).

If the first two cases in the paragraph above applies, a problem when doing this is that it is not fully clear to me how to find the variable associated with the unit root using the M_ and the oo_ structures (I haven’t been able to locate a full description in any of the manuals exactly what is in the M_ and the oo_ structures).

I have tried the following, which I am not sure is correct: associating the eigenvalue with an economic variable or multiplier using the reordering in oo_.dr.order_var. Specifically, I have used 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};

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 :
@#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?).

**Then I can associate a variable with an eigenvalue in oo_.dr.eigval through the reordering in oo_.dr.order_var and thus e.g. limit my search for errors to expressions where that variable occurs. **

However, oo_.dr.order_var 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 (or are the eigenvalues computed on a linear transformation of the variables)?

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


Andreas Westermark
LIE.mod (12.2 KB)

See my answer there: Ramsey Policy - no theoretical moments