Stoch_simul 'Order' Operator

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Stoch_simul 'Order' Operator

Postby jd1090 » Tue Aug 16, 2016 7:51 am

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
Justas Dainauskas
Department of Economics and Related Studies
University of York
Heslington
York
YO10 5DD
United Kingdom
jd1090
 
Posts: 62
Joined: Wed Mar 25, 2015 11:12 am

Re: Stoch_simul 'Order' Operator

Postby jpfeifer » Tue Aug 16, 2016 7:54 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Stoch_simul 'Order' Operator

Postby jd1090 » Tue Aug 16, 2016 10:56 am

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.
Justas Dainauskas
Department of Economics and Related Studies
University of York
Heslington
York
YO10 5DD
United Kingdom
jd1090
 
Posts: 62
Joined: Wed Mar 25, 2015 11:12 am

Re: Stoch_simul 'Order' Operator

Postby jpfeifer » Tue Aug 16, 2016 11:00 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 7 guests