This course teaches you to solve dynamic economic models with neural networks. Building on the numerical methods you learned in Programming & Numerical Methods — root-finding, optimisation, function approximation, and value-function iteration — we introduce deep learning as a powerful new tool for problems that defeat traditional methods: high-dimensional state spaces, occasionally binding constraints, and heterogeneous agents. The approach follows Simon Scheidegger’s open-source framework, adapted for Honours undergraduates. Edinburgh students should check Learn for assessed coursework and announcements.
Prerequisites
You should have completed Programming & Numerical Methods (ECNM10115) or equivalent. Specifically, you need:
- Comfortable programming in Python (NumPy, Matplotlib)
- Familiarity with function approximation (polynomial, spline, Chebyshev)
- Experience with value-function iteration (the neoclassical growth model)
- Basic optimisation (gradient descent, Newton’s method)
No prior deep learning experience is required — we build everything from the ground up.
How to use these materials
Each week has a notebook you can read online, download, or run in the cloud, plus a slide deck for the lecture:
- 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, with GPU access. Nothing to install.
- Run locally — install Anaconda, then
pip install torch matplotlib scikit-learn. Download the .ipynb file and open it in Jupyter.
Note on compute: most notebooks run fine on a laptop CPU. Weeks marked with ⚡ benefit from a GPU — use Colab’s free GPU runtime (Runtime → Change runtime type → T4 GPU).
Materials
Notebooks include interactive exercises with hidden solutions — try first, then click to check.
Syllabus
- From Numerical Methods to Neural Networks — why traditional methods struggle with high-dimensional models; neural networks as universal function approximators; your first network in PyTorch
- Deep Learning Fundamentals — gradient descent, backpropagation, MLPs, activation functions, training loops, overfitting, regularisation
- Automatic Differentiation for Economics — forward vs reverse mode; PyTorch autograd; computing Jacobians and Hessians of economic models; why this matters for equilibrium conditions
- Deep Equilibrium Networks I — from VFI to neural-network solutions; the DEQN principle (minimise equilibrium residuals); deterministic Brock–Mirman growth model with closed-form verification
- Deep Equilibrium Networks II — adding uncertainty; Gauss–Hermite quadrature for expectations; stochastic Brock–Mirman; loss-function design (MSE, Huber, log-cosh)
- Constraints and Real-World Models — borrowing constraints via Fischer–Burmeister complementarity; consumption–savings with an occasionally binding constraint; architecture search basics
- Physics-Informed Neural Networks — continuous-time economics; the PINN principle (ODE/PDE residual minimisation); cake-eating as an HJB equation; soft vs hard boundary conditions
- Heterogeneous Agents — the curse of dimensionality in HA models; Young’s histogram method; Krusell–Smith with DEQNs; deep learning’s comparative advantage
- Surrogates, Estimation, and Climate Economics — Gaussian-process surrogates; simulated method of moments; the DICE integrated assessment model
- Frontiers and Course Synthesis — sequence-space methods, continuous-time HA, decision guide for when to use deep learning vs traditional approaches
How this course relates to PNM
| Root-finding (bisection, Newton) |
Equilibrium conditions as loss functions |
| Optimisation (BFGS, Nelder–Mead) |
Gradient descent, Adam, learning-rate schedules |
| Function approximation (polynomials, splines, Chebyshev) |
Neural networks as universal approximators |
| Value-function iteration |
Deep Equilibrium Networks (DEQNs) |
| Grid-based methods |
Grid-free neural-network solutions |
The key shift: in PNM you approximated value or policy functions on a grid. Here, you parameterise them as neural networks — which scales to problems with 10, 50, or 500 state variables where grids are infeasible.
References
Primary
- Scheidegger, S. (2025). Deep Learning for Solving and Estimating Dynamic Economic Models — open-source course; our main reference and the source of many exercises.
- Azinovic, M., Gaegauf, L., & Scheidegger, S. (2022). “Deep Equilibrium Nets.” International Economic Review, 63(4), 1471–1525.
- Fernández-Villaverde, J., Hurtado, S., & Nuño, G. (2023). “Financial Frictions and the Wealth Distribution.” Econometrica, 91(4), 1251–1293.
Supplementary
- QuantEcon — Sargent & Stachurski, especially the neural-network lectures
- Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep Learning — for the machine-learning foundations (Chapters 6–8)
- Judd, K. (1998). Numerical Methods in Economics — bridges to PNM content