Hi,
I am trying to use the output of Dynare to do some other calculation and have couple of questions:

How to match the AUX Variables with the original variables, I know M_.aux_vars contains “endo_index” and “orig_index” for some AUX Variables. But the value of “orig_index” is empty for some variables.

2.How to indentify the state variables (i.e. pred variables)? I know oo_.dr_npred contains the number of state varibles. But what exactly are those varibles? Name/endo_index?

I have the impression that there is no obvious programmatic way for obtaining this information. An auxiliary variable can be a complex non linear combination of endogenous variables so that it is not possible to describe it by only using indices. You can use the write_latex_dynamic_model to print the equations of the model in a tex file that you can compile with (pdf)latex. For instance, if you try with fs2000 you will get the following last equation (tex):

which is easeier to read if you compile the document

To get the indices of the state variable you can use the following command:

idstate = find(M_.lead_lag_incidence(1,:));

and to print the corresponding variable names:

M_.endo_names(idstate,:)

You would get the same names by looking at the variables listed in the first column of the table “POLICY AND TRANSITION FUNCTIONS” produced by the stoch_simul command.