Page 1 of 1

Stoch_simul 'Order' Operator

PostPosted: Tue Aug 16, 2016 7:51 am
by jd1090
Hi,

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?

Thanks

Re: Stoch_simul 'Order' Operator

PostPosted: Tue Aug 16, 2016 7:54 am
by jpfeifer
If your are using
Code: Select all
stoch_simul
, you can simply have
Code: Select all
stoch_simul(order=1)

followed by
Code: Select all
stoch_simul(order=2)

in the same mod-file.

Re: Stoch_simul 'Order' Operator

PostPosted: Tue Aug 16, 2016 10:56 am
by jd1090
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
Code: Select all
dynsave (filename) variable_of_interest;


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.

Re: Stoch_simul 'Order' Operator

PostPosted: Tue Aug 16, 2016 11:00 am
by jpfeifer
Simply do
Code: Select all
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.