<p>Since I am coding some linear New Keynesian models in python and solving them under rational expectations (using the method of undetermined coefficients/linear time iteration), I was wondering whether anyone codes non-linear rational expectations models (e.g. with the ZLB)? I heard these are much more complex to solve and it is recommended to just solve them using dynare + OBC / occbin.</p>
<p>The question is, is it generally sensible to solve non-linear models in python/matlab by coding the solution algorithm yourself? Or is this too complex and you would recommend using dynare + OBC / occbin?</p>

CC BY-SA 4.0
2021-07-31T14:26:47.613Z
Could you please elaborate on what exactly you mean by "sensible"? :) I mean what are your goals, why would you prefer not to use dynare + OBC if that is an option?
Giskard
CC BY-SA 4.0
2021-07-31T14:29:33.990Z
The reason is that using dynare+OBC you are not solving the model yourself, but using a "black-box" solution method where the software does it all for you. It would be preferable to show that I can do it myself, if feasible with reasonable amount of work. If it is too complex, I will have to resort to dynare + OBC anyway. I want to implement the ZLB in a RE model and show what implications this has, i.e. derive some IRFs for different types of shocks e.g.
Suttungr
<new-keynesian-economics><computation><dynare><python><expectations>
Solving Rational Expectation Models Linear vs. Nonlinear
Suttungr
# Solving Rational Expectation Models Linear vs. Nonlinear

(Asked by: username_0 on 2021-07-31)

Since I am coding some linear New Keynesian models in python and solving them under rational expectations (using the method of undetermined coefficients/linear time iteration), I was wondering whether anyone codes non-linear rational expectations models (e.g. with the ZLB)? I heard these are much more complex to solve and it is recommended to just solve them using dynare + OBC / occbin.

The question is, is it generally sensible to solve non-linear models in python/matlab by coding the solution algorithm yourself? Or is this too complex and you would recommend using dynare + OBC / occbin?

**Tags:** new-keynesian-economics, computation, dynare, python, expectations

> **Comments:**
> **username_1**: Could you please elaborate on what exactly you mean by "sensible"? :) I mean what are your goals, why would you prefer not to use dynare + OBC if that is an option?  
> **username_0**: The reason is that using dynare+OBC you are not solving the model yourself, but using a "black-box" solution method where the software does it all for you. It would be preferable to show that I can do it myself, if feasible with reasonable amount of work. If it is too complex, I will have to resort to dynare + OBC anyway. I want to implement the ZLB in a RE model and show what implications this has, i.e. derive some IRFs for different types of shocks e.g.  

---

## 0 answers

