Pruning, Explosive IRFs with second order approximation

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.

Pruning, Explosive IRFs with second order approximation

Postby sfahr » Thu Jan 07, 2010 3:51 pm

This post combines three files to implement pruning in Dynare for different versions (3.065, 4.0.4 and 4.1.0).
Pruning is useful to generate non-explosive simulations with second order approximations, it does not work for the 3rd order approximation I introduced the option for the pruning algorithm for all three Dynare versions following Kim, Kim, Schaumburg and Sims (2008): "Calculating and using second order accurate solutions of discrete time dynamic equilibrium models", JEDC.

In order to use it correctly, please proceed as follows:
1. Download the simult_pruningV.m to the Dynare directory, generally under ..\dynareV\matlab, where V stands for the Dynare Version you use.
2. Rename the original file simult_.m to simult_original.m
3. Rename the file simult_pruningV.m to simult_.m,
4. Just before the stoch_simul(...) command within your Dynare model file *.mod add the line

Code: Select all
options_.pruning=1;


If you want to compare to the standard simulation just take out the line or set options_.pruning=0;

Code: Select all
model; ...
end;

initval; ...
end;

steady;
shocks;
var e_x=std_x^2;
end;

options_.pruning=1;
stoch_simul(irf=15,replic=500)y c k;


A word of caution: Obviously, it is not assured that the new version of simult_.m is bug free. Check your results if they appear plausible! This may be done by using smaller shocks and comparing the results with and without pruning. They should be virtually identical. Pruning is often required to make a simulation stable in the presence of large shocks. But with large shocks it may be that a second-order approximation is not a good approximation because you are too from the steady state, so the solution is very inaccurate.

Any further suggestions or found errors, please post on this forum.
Stephan Fahr

Older posts on this have been:
http://www.dynare.org/phpBB3/viewtopic.php?f=2&t=1669
http://www.dynare.org/phpBB3/viewtopic.php?f=2&t=2171
Attachments
simult_pruning410.m
(5.05 KiB) Downloaded 329 times
simult_pruning404.m
(4.84 KiB) Downloaded 491 times
simult_pruning3065.m
(2.84 KiB) Downloaded 225 times
sfahr
 
Posts: 4
Joined: Thu Nov 15, 2007 9:29 am

Re: Pruning, Explosive IRFs with second order approximation

Postby lombard » Fri Jan 08, 2010 8:27 am

Fantastic!

Thanks a lot Stephan for making this available to us.

Too bad that a workaround is not available for the third order ... yet

Cheers

Gianni :lol:
lombard
 
Posts: 132
Joined: Wed Feb 02, 2005 12:36 pm
Location: Basel


Return to Dynare contributions and examples

Who is online

Users browsing this forum: No registered users and 5 guests