Stoch_simul 'Order' Operator


I’m writing up an .m file to plot graphs (IRFs, histograms etc.) and I’m trying to compare a non-linear model solution to its linearised counterpart (i.e. 2nd vs 1st order approximation).

I was wondering if there is a way (similar to a pound operator for model local variables) to access the stoch_simul command to change the order of the approximation using set_param_value or something similar. The other option is to save two types of .mod files (one with 1st, the other one with 2nd order), but I was hoping there might be a more efficient and direct way?


If your are using stoch_simul, you can simply have

followed by

in the same mod-file.

That’s right, but one output overwrites the other and that defeats my purpose. I’m modifying the appearance of the IRFs and histograms in a separate .m file.

I tried using

But this only saves the output of the endo_simul (i.e. model generated data from the option periods = integer).

Is there any other way of saving the IRFs or choosing the order externally?

Many thanks.

Simply do

stoch_simul(order=1); save('results_order_1','oo_','M_','options_'); stoch_simul(order=2); save('results_order_2','oo_','M_','options_');
to store the results in every step.