but the model should be non-linear or linear regardless of the parameter values

# 3rd order perturbation closing devices Uribe

**sfaf**#22

But you mentioned in this notes that a whether model is linear or not linear depends on the values of the parameters.

**jpfeifer**#23

@sfaf I don’t understand the question. A model can be highly nonlinear, but when you solve it at first order, you are doing a linear approximation, i.e. you will turn it into a linear model.

**sfaf**#24

Sorry Johannes, I thought that above notes is from you. I don’t have any question. As I had cleared my concept in the beginning of this conversion.

Thanks.

**sfaf**#25

stochastic.mod (5.7 KB)

Hello Professor Johannes,

Please find attached codes IDEIR SGU 2003, I build these based on your codes for **Basu_Bundick_2017** and **Ambrogio Cesa-Bianchi** I want find two things, one to stochastic steady state as you did for Risk matters. Second, to find IRFs starting at the stochastic steady state. I could not figure out how to get stochastic steady state/risky steady state. Though these codes are working fine but IRFs are awkward. something wrong. Please help.

**jpfeifer**#26

Setting

```
shock_mat(1+burnin,strmatch('eps_sigma_a',M_.exo_names,'exact'))= 1;
```

does not work, because there is no shock named `eps_sigma_a`

in your model.

Risky steady state for SGU 2003

**sfaf**#27

Thanks you so much it worked for me I replied to you on another post. I have learned a lot from you and from this forum in the last few months. I am greatly thankful to you.

PAC2.mod (3.5 KB)

Please find attached codes for PAC model as one of the closing devices (SGU 2003). I am using now your codes of Risk matters. For me these are a bit complicated to understand than for Basu/Bundick. First, I would like to confirm that, as in your paper, Erg. Mean(SS) given in Appendix F are the same as **ergodicmean_no_shocks** that I get from dynare output.

Can I get **(IRFs) from the ergodic mean in the absence of shocks**

**(EMAS)**? from the codes I have attached. Lastly, I want to find the second moments PAC model from this pruning scheme. I could not yet figure out. Please help me on this.

Best Regards,

Shafi

**sfaf**#28

PAC2.mod (6.1 KB)

Hi Professor Johannes,

This is in continuation of the above post. Please find attached updated version of PAC2. Trying to build IRFs based on your codes for Risk matter for using pruning scheme of Andreasen et al. (2013). I think something still wrong with IRFs.

I used PruninngDynare4.4 of Martin Andreasen

https://sites.google.com/site/mandreasendk/home-1/Codes/Dynare44Pruning.zip?attredirects=0&d=1 It gives me very similar second moments as when I do it Dynare using pruning option. Is dynare pruning scheme is same as by Martin Andreasen. I am copying from Dyanre Manual " **Discard higher order terms when iteratively computing simulations of the solution. At second order, Dynare uses the algorithm of Kim, Kim, Schaumburg and Sims (2008), while at third order its generalization by Andreasen, Fern´andez-Villaverde and Rubio-Ram´ırez (2013) is used."** It means they are same as Dynare pruning scheme. However, difference in IRFs Dynare gives us based on simlulation while Andreasen analytical GIRFs. Right?

**jpfeifer**#29

Hi,

Dynare uses the same pruning scheme, but Andreasen reports GIRFs, i.e. generalized IRFs. If you want to write paper, please use the Basu/Bundick codes for generating IRFs at the stochastic steady state/EMAS. The Risk matters codes had to follow the original AER paper and are less than ideal.