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:

- Download the simult_pruningV.m to the Dynare directory, generally under …\dynareV\matlab, where V stands for the Dynare Version you use.
- Rename the original file simult_.m to simult_original.m
- Rename the file simult_pruningV.m to simult_.m,
- Just before the stoch_simul(…) command within your Dynare model file *.mod add the line

`options_.pruning=1;`

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

```
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:

[Pruning algorithm for second order approximation)

[Pruning implementation for Dynare 4.0.4?)

simult_pruning410.m (5.05 KB)

simult_pruning404.m (4.84 KB)

simult_pruning3065.m (2.84 KB)