Page 1 of 1

Pruning, Explosive IRFs with second order approximation

PostPosted: Thu Jan 07, 2010 3:51 pm
by sfahr
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

Re: Pruning, Explosive IRFs with second order approximation

PostPosted: Fri Jan 08, 2010 8:27 am
by lombard
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: