This course teaches you to solve economic problems with code: writing clean programs in Python, implementing the numerical methods behind modern macroeconomics (root-finding, optimisation, dynamic programming), and building small models from scratch. The materials below are open to everyone — Edinburgh students should still check Learn for assessed coursework and announcements.
How to use these materials
Each week has a notebook you can read online, download, or run in the cloud:
- Read online — click the notebook link; it renders as a webpage with all code and output.
- Run in Google Colab — click the Colab badge and the notebook opens ready to run in your browser. Nothing to install.
- Run locally — install Anaconda (includes Python, Jupyter, NumPy, and Matplotlib), then download the
.ipynbfile from the links below and open it in Jupyter. New to Python? Start with the Python Refresher repository alongside PS0.
Quick experiments: try the Python Playground — run and edit course code directly in your browser, nothing to install.
Materials
| Week | Topic | Notebook | Slides | Colab |
|---|---|---|---|---|
| 1 | Introduction to Programming | View · Download | ||
| 2 | Fundamentals of Programming in Python | View · Download | ||
| 3 | Data Manipulation with pandas | pandas · Case study | ||
| 4 | From Data to Models | View | ||
| 5 | Numerical Methods I — Root-Finding & Optimisation | View | PDF · Optimisation · VF Approx. | |
| 6 | Numerical Methods II — Optimisation in Economics | View | ||
| 7 | Numerical Methods III — Function Approximation | View · Examples | ||
| 8 | Economic Models — Value Function Iteration | View (Julia) | — | |
| 9 | Model Estimation — Simulation & Inference | — | — | |
| 10 | Advanced Topics — Heterogeneous Agents | — | — |
Notebooks include interactive exercises with hidden solutions — try first, then click to check.
Datasets: the survey datasets used in the Week 3 case study, labs, and problem sets (UNPS and related microdata) are distributed through Learn, not this website, for licensing reasons. Notebooks are published with their outputs embedded, so you can follow everything here.
Test yourself: take the Numerical Methods Quiz — 14 multiple-choice questions covering root-finding, optimisation, and function approximation (Weeks 5–8) with instant feedback.
Extra reading: pandas cheat sheet · Quadrature Methods · Math Review
Syllabus
- Introduction to programming
- Fundamentals of programming in Python
- Data manipulation and data analysis
- From data to models
- Numerical Methods I
- Numerical Methods II
- Numerical Methods III
- Economic models
- Model estimation
- Advanced topics
References
- Numerical Methods in Economics, Kenneth L. Judd (1998) — main reference for the numerical-methods weeks
- QuantEcon — T. Sargent and J. Stachurski’s open lectures, main reference
- Advanced: Jesús Fernández-Villaverde’s Computational Methods for Economists lecture notes
Questions
Found an error in a notebook, or stuck on setup? Email juan.zurita@ed.ac.uk — see For Students for how to get a fast answer.