A short applied dynamic programming course
Dynamic programming is the work horse of modern macroeconomics. The mathematical theory behind dynamic programming can be quite hard going. John Rust provides a concise overview in his Palgrave article. However, using dynamic programming on a computer to solve macroeconomic models is surprisingly easy. This mini-course was designed for graduate students in macroeconomics and international finance with some idea of dynamic programming.
I think this material can be used for advanced undergraduates interested in modern macroeconomics. I think the computer code could easily be used by an undergraduate student to write a final year disseration.
I wrote this course before I got into open source software, hence the example code is written in MATLAB. Although there are student offers for MATLAB, the program can still be quite expensive for a student, especially when there are FREE alternatives around. Unfortunately, many economist write their programs in MATLAB so it is useful to have an idea of the language, especially if you want to use their code.
There are a number of free open source alternatives to MATLAB, (1) Octave which has MATLAB like syntax. My example code should work on Octave with a few modifications. (2) The second alternative is Python and the Python libraries NumPy and SciPy. Since Python is a very versitile language this is a better long term strategy. I will post code for Octave and Python when I get round to it.
The best way to learn computer programming is by doing, so work through the examples. Enjoy.