Auxiliary variables and DR order


Does anyone know how auxiliary variables such as k(-2) or I(-1) are put inside the DR order? For example do the original state variables still come first after the static variables (followed by the auxiliary variables)? I couldn’t find a clear explanation of this in the reference manual or wiki.

I want to be able to do my own arbitrary simulations using the dynare decision rules and recover the simulated time series of the original endogenous variables . I’ve successfuly coded and tested this with the example mod files without auxiliary variables for the first order approximation. One could of course just define the model in the model block using manual auxiliary variable definitions, but it would be nice to be able to do this with a mod file where you let dynare take care of auxiliary variables (especially for long leads or lags).

Also, suppose I have lags in an exogeneous shock (a moving average). How would this affect the DR order of the variables in dynare’s solution?
Thanks a lot for any insight.


1 Like

The k(-2) will be replaced by an auxiliary variable, which will itself appear with one lag. So that auxiliary variable will be in the “backward” variables. Within the backward variables, this aux var will come after the variables which have been manually declared. If you want to find the exact index, you need first to figure out the ID of the aux var in the declaration order (by looking at the contents of M_.aux_vars, see and then you can find its place in the DR order by looking at oo_.dr.order_var (see the ref manual, section about stoch_simul).

The case of I(-1) is a bit different: no aux var will be created in this case, so you can directly look at oo_.dr.order_var.

An endogenous aux var will be created, and it will follow the same rules than the aux var created in the endogenous case described above.

ok, thanks!