Deep Learning for Solving Economic Models (ECO-AD-DEEPLEARN)
ECO-AD-DEEPLEARN
| Department |
ECO |
| Course category |
ECO Advanced courses |
| Course type |
Course |
| Academic year |
2026-2027 |
| Term |
BLOCK 3 |
| Credits |
.5 (EUI Economics Department) |
| Professors |
- Florian Oswald (University of Turin)
|
| Contact |
Aleksic, Ognjen
|
| Sessions |
|
| Syllabus |
Link
|
| Enrolment info |
27/08/2026 - 10/02/2027 |
Description
Deep Learning for Solving Economic Models
Teacher: Florian Oswald
Abstract:
Dynamic economic models rarely admit closed-form solutions. For decades, economists have relied on numerical methods such as value function iteration, pertur bation, and projection techniques — all of which suffer from the curse of dimensionality. Deep learning offers a fundamentally different approach: flexible function approxima tors that learn an efficient representation of the solution, and that scale to state spaces that were previously computationally infeasible. This course teaches you to use these tools.
1 Course Overview
This is an intensive PhD course taught at the European University Institute, Fiesole. Date and time to be confirmed. The course consists of 5 sessions of 2 hours each (10 hours total). Each session combines a conceptual block with a hands-on coding exercise. In the words of Che-Lin Su: Doing Computation is the only way to learn Computation. Doing Computation is the only way to learn Computation. Doing Computation is the only way to learn Computation. The main theoretical reference is the survey by Fernández-Villaverde (2024), which frames solving equilibrium economic models as a problem of function approximation and shows how deep neural networks provide a practical solution. We will work through the key ideas in that paper and implement them ourselves.
2 Prerequisites
2.1 Economics
Students should be comfortable with the following at the level of a first-year PhD sequence: • Dynamic programming: Bellman equations, value function iteration, policy functions. A great reference is Dynamic Programming by Sargent and Stachursky.
• Neoclassical growth model: the deterministic and stochastic versions, Euler equations, trans versality conditions.
• Numerical methods basics: some prior exposure to function approximation (e.g. Chebyshev polynomials, finite elements) or value function iteration on a grid is helpful but not strictly required. The relevant background is covered in my Computational Economics course.
2.2 Programming
Students should arrive with a working knowledge of at least one scientific programming language. The course uses Julia for Sessions 1–2 and Python (PyTorch) for Sessions 3–5. Concretely:
• Julia: familiarity at the level covered in the Computational Economics course — writing functions, working with arrays, using packages, running scripts. No prior exposure to Flux.jl or other ML libraries is assumed.
• Python: basic familiarity with Python syntax and numpy. No prior PyTorch experience is assumed; what you need will be introduced in Session 3. Please find detailed software installation instructions in the section Section 7.
3 Content 3.1 Session 1 — What is Deep Learning?
Concepts
• A taxonomy of machine learning: supervised, unsupervised, and reinforcement learning. • Anatomy of an artificial neural network: neurons, weights, biases, activation functions (sigmoid, ReLU, tanh, softmax).
• From a single layer to deep networks; the forward pass as function composition. • Loss functions and the idea of learning as optimisation. Hands-on (Julia) • Classify / vs \ from 4-pixel images: solve for the network weights analytically and verify the solution by hand.
• Scale up to 5×5 pixel digit recognition (10 classes, 30 training images): implement gradient descent from scratch — no library, every line written by the student.
• Visualise loss convergence and inspect the learned weight matrices. Takeaway: a neural network is a parametric function approximator; training is just minimising a loss over labelled examples by following the gradient.
3.2 Session 2 — Neural Networks as Function Approximators Concepts
• Why economists need function approximation: value functions, policy functions, decision rules, pricing kernels.
• Classical fixed-basis methods: linear approximation, polynomial terms, Chebyshev polynomials — and why they break down as the number of state variables grows. • Neural networks as learned bases: instead of prescribing basis functions ex ante, the network learns them during training. 2
• The universal approximation theorem (Cybenko 1989; Hornik et al. 1989): a single-hidden- layer network can approximate any Borel-measurable function to arbitrary accuracy. Hands-on (Julia / Flux) • Approximate the six Genz (1987) test functions (oscillatory, product peak, corner peak, Gauss ian, continuous, discontinuous) in 2, 5, and 10 dimensions.
• Vary training sample size (10, 50, 100, 500 points) and measure max and average out-of-sample error. • Compare NN approximation error against a polynomial baseline as dimension grows. Takeaway: NNs sidestep the curse of dimensionality by learning efficient representations; approximation error degrades much more gracefully with dimension than Chebyshev grids.
3.3 Session 3 — Training Deep Networks Concepts
• Backpropagation: the chain rule applied layer by layer; automatic differentiation. • Optimisers: stochastic gradient descent, momentum, Adam. • Architecture design: how to choose depth, width, and activation function. • Regularisation techniques: weight decay, dropout, batch normalisation.
• Practical diagnostics: learning curves, overfitting, gradient vanishing/exploding. Hands-on (Python / PyTorch)
• First 20 minutes: side-by-side comparison of the Session 2 Flux code and equivalent PyTorch code — same computation, different syntax.
• Train a deep neural network to approximate the value function of the deterministic neoclas sical growth model using the Bellman residual formulation.
• Compare the learned value and policy functions against a finite-difference reference solution.
• Experiment with network width, depth, and learning rate; observe effects on convergence. Takeaway: training is high-dimensional optimisation; architecture choices have interpretable consequences for the quality and stability of the approximation.
3.4 Session 4 — Solving Economic Models: The Equilibrium Loop
Concepts
• Three ways to formulate the residual of an economic model: 1. Value function / Bellman residual — work with the recursive formulation directly. 2. Euler equation residual — approximate the decision rule (policy function). 3. Conditional expectations / PEA — approximate the expectation term; useful when the decision rule has kinks (e.g. zero lower bound).
• The equilibrium loop: the correct evaluation points for training are generated by the equilibrium we are trying to solve — a circularity absent from standard ML problems.
• Epoch structure: guess parameters ¿ simulate ¿ minimise residuals ¿ re-simulate ¿ iterate. Hands-on (Python / PyTorch)
• Solve the stochastic neoclassical growth model (TFP shocks, CRRA utility) using the Euler equation residual approach. • Implement the full equilibrium loop: initialise, simulate, train, re-simulate. • Compare consumption and capital policy functions against the finie-difference benchmark.
• Explore how performance changes with epoch count, network size, and number of simulation periods. Takeaway: the equilibrium loop is the central algorithmic challenge; NNs handle it well because they generalise across the state space rather than memorising grid values.
3.5 Session 5 — Extensions and the Research Frontier Concepts
• Heterogeneous-agent models: why the state space explodes and what changes algorithmically. • Deep Equilibrium Nets (Scheidegger & Bilionis 2019): global solutions with large numbers of state variables by construction.
• Continuous-time models: solving Hamilton-Jacobi-Bellman equations with neural networks.
• Connection to reinforcement learning: policy gradient, Q-learning, and value iteration as special cases of the general framework.
• Open questions: convergence guarantees, solution accuracy diagnostics, multi-equilibria. Hands-on (Python) • Run and modify the DeepEquilibriumNets code or the HJB solver; scale up the state space and observe how computation time and approximation quality evolve.
• Open discussion: what can deep learning do today that was impossible five years ago, and where are the remaining bottlenecks? Takeaway: DL has shifted the frontier of tractable economic models; the bottleneck is now the quality of the equilibrium loop and problem-specific architecture design, not dimensionality per se.
4 Project
The goal of your project is to show that you can translate a dynamic economic model into a function approximation problem, implement the equilibrium loop, and interpret the output. There are three options of increasing ambition; choose the one that fits your background and research agenda.
All three options share the same submission requirements:
1. A GitHub repository (public, or private and shared with the instructor) containing your code. It must be reproducible: a reader should be able to clone the repo and run your main script without modification.
2. A short write-up of at most 6 pages covering: the model, the residual formulation you chose, your network architecture and why, and what your results look like. Figures count toward the page limit.
4 4.1 Option A — Extend the Course Model
The instructor provides a working implementation of the stochastic neoclassical growth model from Session 4. You make one meaningful modification to the model and document the consequences for the solution. Possible extensions (you may propose others): • Add habit formation in preferences.
• Impose an occasionally binding borrowing constraint.
• Switch to irreversible investment.
• Introduce a second exogenous shock (e.g. a preference shock alongside TFP).
• Change the utility specification (e.g. Epstein-Zin preferences).
You must: (i) derive the modified residual equations, (ii) re-train the network, and (iii) compare the new policy functions against the baseline model. A grid-based comparison is not required, but the direction and intuition of the change must be discussed. This is the right option if you are newer to computational methods or if your own research is not yet close to dynamic quantitative models.
4.2 Option B — Curse-of-Dimensionality Audit
Take an instructor-provided model and solve it for ¿ = 1,2,3,4 state variables using both a classical method (Chebyshev collocation or value function iteration on a grid) and a neural network. Produce a clean comparison of: • wall-clock time as a function of ¿; • approximation error (relative to a high-accuracy benchmark) as a function of ¿;
• how the network architecture you chose scales with ¿. Write a short report interpreting what you find. Does the neural network’s advantage appear at the dimensionalities tested, or only beyond them? What are the failure modes of each method? This is the right option if you want a structured empirical exercise in computational performance rather than economic modeling. It directly addresses the core motivation of the course and produces results that are easy to evaluate.
4.3 Option C — Apply to Your Own Research
Pick a dynamic model from your own research area — search and matching, life-cycle savings, firm dynamics, spatial equilibrium, asset pricing, or anything else — that you have either seen analytically or solved with a simpler numerical method. Set it up as a deep learning problem from scratch:
1. Write down the equilibrium conditions and choose a residual formulation.
2. Implement the equilibrium loop.
3. Plot and interpret the policy or value functions.
4. If a grid-based or analytical solution exists, compare against it.
5 The model does not need to be your dissertation model, and you do not need to reach research quality accuracy. The point is that you leave the course with working code for a problem you actually care about. This is the right option if you have an active research agenda involving a dynamic quantitative model. You leave the course with something directly useful.
5 Grade
Pass / fail based on the project. There are no homeworks.
6 Key References
6.1 Main Reference • Fernández-Villaverde, J. (2024). Deep Learning for Solving Economic Models. Journal of Economic Literature (forthcoming). PDF 6.2 Deep Learning • Prince, S.J.D. (2023). Understanding Deep Learning. MIT Press. Open access. • Murphy, K.P. (2022, 2024). Probabilistic Machine Learning, Vols. 1–2. MIT Press. Open access at https://probml.github.io/pml-book/. • Aggarwal, C.C. (2023). Neural Networks and Deep Learning. Springer. 6.3 Computational Economics (background) • Judd, K. (1998). Numerical Methods in Economics. MIT Press. • Fernández-Villaverde, J., Rubio-Ramírez, J.F., and Schorfheide, F. (2016). Solution and Estimation Methods for DSGE Models. Handbook of Macroeconomics, Vol. 2. • Quantitative Economics with Julia: https://julia.quantecon.org 6.4 Selected Applications • Scheidegger, S. and Bilionis, I. (2019). Machine Learning for High-Dimensional Dynamic Stochastic Economies. Journal of Computational Science. • Maliar, L., Maliar, S., and Winant, P. (2021). Deep Learning for Solving Dynamic Economic Models. Journal of Monetary Economics. • Azinovic, M., Gaegauf, L., and Scheidegger, S. (2022). Deep Equilibrium Nets. International Economic Review. 6.5 Reinforcement Learning • Sutton, R.S. and Barto, A.G. (2018). Reinforcement Learning: An Introduction. MIT Press. Open access at http://incompleteideas.net/book/the-book.html. 7 Installation Instructions Julia 1. Install the latest stable Julia release. 2. Install VSCode with the Julia extension. 6 Python The course Python code requires torch >= 2.0, numpy, and matplotlib. A GPU is not required; all exercises run on CPU in reasonable time. Set up an isolated environment using one of the three options below — pick whichever fits your workflow. Option 1 — venv (built into Python, no extra tools needed) python -m venv deep-econ source deep-econ/bin/activate # macOS / Linux # deep-econ\Scripts\activate # Windows pip install "torch>=2.0" numpy matplotlib Option 2 — conda (recommended if you already use Anaconda or Miniconda) conda create -n deep-econ python=3.11 conda activate deep-econ conda install pytorch numpy matplotlib -c pytorch Option 3 — pyenv
ENROL FOR THIS COURSE
Page last updated on 05 September 2023