<p>One of the best resources I have found is the book by Kindermann and Fehr, <em>Introduction to Computational Economics using Fortran</em>. This book covers most of the macroeconomic models and some variations, including Ramsey-Cass-Koopmans, and the New Keynesian models. The code is written in Fortran, but it is not too bad to adapt that code to a different language. The workhorse functions in the fortran code are <code>fsolve</code> and <code>fzero</code>, which are for solving linear systems of equation and root finding--for non-linear root finding problems. So the math is not too bad, and it is nice to see how the problems are setup.</p>
<p>There is also a website where people can post questions about the code.</p>
<p><a href="https://www.ce-fortran.com/" rel="nofollow noreferrer">https://www.ce-fortran.com/</a></p>

CC BY-SA 4.0
2022-11-28T15:11:31.853Z
2022-11-28T15:11:31.853Z
krishnab
<p>I am new to the area of DSGE modelling, and programming DSGE models. I was hoping that someone could recommend a book on DSGE modelling, that presents the different model components as well as code for numerically running/optimizing the components of those models. I am particularly interested in the numerical methods for solving these models.</p>
<p>As I am learning more about these models, it helps to have some existing simple solved codes, so that I know what working examples look like. That way when I run experiments, I have a bit more confidence that I am doing it correctly.</p>
<p>So far the best resource I have found are the <a href="https://quantecon.org/lectures/" rel="nofollow noreferrer">quantecon lectures</a>. These lectures use both the Julia and Python languages, and I am well versed in both. In terms of the reference request, any language would probably be good, matlab, julia, python, etc. What I would like to avoid is just using a package or black box, where the internals are hidden from the user.</p>
<p>Thanks.</p>

CC BY-SA 4.0
2022-06-27T09:14:46.147Z
What do you mean by "simple solved codes"? Usually researchers build a more general tool that can than be applied to both simple and more complicated models. Also, the general theories behind the solution approaches are generally quite complicated,. Have you looked into numerical methods in Economics?
BrsG
CC BY-SA 4.0
2022-06-27T16:32:28.473Z
@BrsG I think I just called them codes because in numerical PDEs we usually call the solvers codes. So that was just a habit. What I am looking for is something that actually shows the optimization code or simulation code for simpler models. For example in the quantecon lectures, the linear programming solver is a function in a package--so the user does not see what happens. I can find the code for simple interior point solvers anywhere, but then I might get different results from the examples. Thus it is nice to have simple examples with simple codes with them.
krishnab
CC BY-SA 4.0
2022-06-27T16:38:38.980Z
@BrsG the other thing is, if I am trying to disect the source code for some package, it can be pretty brutal to hunt through all of the internal functions and files to figure out the final algorithm. And even if a user suceeds in doing that, trying to replicate that algorithm outside in a new simplified form takes a lot of time. I mean I have done that with Fortran codes, and it takes forever to get it right. So that is what I was looking for.
krishnab
<reference-request><numerical-methods>
Reference request: a book on numerically solving DSGE models with code
krishnab
# Reference request: a book on numerically solving DSGE models with code

(Asked by: username_0 on 2022-06-25)

I am new to the area of DSGE modelling, and programming DSGE models. I was hoping that someone could recommend a book on DSGE modelling, that presents the different model components as well as code for numerically running/optimizing the components of those models. I am particularly interested in the numerical methods for solving these models.

As I am learning more about these models, it helps to have some existing simple solved codes, so that I know what working examples look like. That way when I run experiments, I have a bit more confidence that I am doing it correctly.

So far the best resource I have found are the [quantecon lectures](https://quantecon.org/lectures/). These lectures use both the Julia and Python languages, and I am well versed in both. In terms of the reference request, any language would probably be good, matlab, julia, python, etc. What I would like to avoid is just using a package or black box, where the internals are hidden from the user.

Thanks.

**Tags:** reference-request, numerical-methods

> **Comments:**
> **username_1**: What do you mean by "simple solved codes"? Usually researchers build a more general tool that can than be applied to both simple and more complicated models. Also, the general theories behind the solution approaches are generally quite complicated,. Have you looked into numerical methods in Economics?  
> **username_0**: @username_1 I think I just called them codes because in numerical PDEs we usually call the solvers codes. So that was just a habit. What I am looking for is something that actually shows the optimization code or simulation code for simpler models. For example in the quantecon lectures, the linear programming solver is a function in a package--so the user does not see what happens. I can find the code for simple interior point solvers anywhere, but then I might get different results from the examples. Thus it is nice to have simple examples with simple codes with them.  
> **username_0**: @username_1 the other thing is, if I am trying to disect the source code for some package, it can be pretty brutal to hunt through all of the internal functions and files to figure out the final algorithm. And even if a user suceeds in doing that, trying to replicate that algorithm outside in a new simplified form takes a lot of time. I mean I have done that with Fortran codes, and it takes forever to get it right. So that is what I was looking for.  

---

## 1 answers

### Answer by username_0 on 2022-11-28. Score: 1 | Accepted answer

One of the best resources I have found is the book by Kindermann and Fehr, *Introduction to Computational Economics using Fortran*. This book covers most of the macroeconomic models and some variations, including Ramsey-Cass-Koopmans, and the New Keynesian models. The code is written in Fortran, but it is not too bad to adapt that code to a different language. The workhorse functions in the fortran code are `fsolve` and `fzero`, which are for solving linear systems of equation and root finding--for non-linear root finding problems. So the math is not too bad, and it is nice to see how the problems are setup.

There is also a website where people can post questions about the code.

<https://www.ce-fortran.com/>


---

