Numerical Methods Course by Judd

Return to Ken Judd’s Home Page

Dr. Kenneth L. Judd

judd@stanford.edu
Herbert Hoover Memorial Building, Room 150
Hoover Institution
434 Galvez Mall
Stanford, CA. 94305

Objective

This course introduces computational approaches for solving economic models. It focuses on a broad range of numerical methods and then applies them to economic problems. We formulate economic problems in computationally tractable forms and use numerical analysis techniques to solve them. We will study examples of computational techniques in the current economic literature as well as discuss areas of economic analysis where numerical analysis may be useful in future research of dynamic economic problems. The substantive applications will cover a wide range of problems including public finance, macroeconomics, game theory, mechanism design, econometrics, finance, and industrial organization.

Overview

We begin with an overview of the necessary numerical analysis and approximation theory. First, we review standard numerical analysis – interpolation and approximation techniques, numerical optimization, numerical solutions to systems of linear and nonlinear equations, numerical integration, and basic solution techniques for ordinary and partial differential equations. We also discuss perturbation methods useful in economics.

Second, there will be an emphasis on applications related to current research areas. We will discuss methods for solving dynamic programming problems, as well as dynamic stochastic equilibrium models. We will solve for optimal incentive mechanisms using numerical optimization.

The course aims to acquaint students with the range of techniques that have been useful in economic analysis as well as expose students to techniques that have potential use in economic applications. I want to develop a basic understanding of numerical methods, demonstrate their use in economic examples, show how existing techniques fit into the broader numerical literature, and point the students to potentially useful numerical techniques.

Prerequisites

It is best if students have a good undergraduate background in mathematics (such as calculus, linear algebra, eigenvalues and eigenvectors) and are familiar with static optimization theory (such as Lagrangians and Karush-Kuhn-Tucker conditions) as well as basic dynamic optimization theory. I will also presume some experience with graduate level economics, however any student who is interested in the course and has taken either Masters or PhD courses in econometrics, microeconomics, and macroeconomics will be able to follow the course.

Computing Languages

Students need to know use some computational language. Python, Matlab and R are relatively easy to learn and can handle the simple examples in my lectures. Matlab is the most used language in economics. Python is a more complex programming language but much better in terms of long-run value and flexibility. The QuantEcon project of Sargent and Stachurski focuses on Python. More advanced students will use FORTRAN, C, C++ or Julia. Statistical software such as TSP, Eviews, RATS, and SAS are not acceptable. The US Federal Reserve uses Eviews but I expect more of you. Don’t even ask about Excel.

In operations research and applied general equilibrium, researchers often use modeling languages, such as GAMS and AMPL. They are easy to learn because all you need to do is describe your problem and tell the modeling language what algorithm you want to use. AMPL and GAMS allows you to access the best numerical software which is usually commercial. However, one submit jobs to the NEOS website for FREE, reflecting the “Wisconsin idea”!

I often use Mathematica in my lectures and classnotes. It allows one to use symbolic methods, has good graphics and is overall more flexible than Matlab. Mathematica is not free but the CDF player is free and it will allow you to run some examples on your laptops.

Textbook

The text is Numerical Methods in Economics by Judd, published by MIT Press. I will be particularly appreciative of any comments you may have on the text (typos, lack of clarity, etc.) since I am beginning to prepare the second edition.

I am working on a second edition. As we progress, I will (hopefully) have drafts on the course website of chapters for the second edition.

Course Outline and Schedule

TopicDetailsVideos and Course Materials
Lecture 1:
Introduction
Chapter 1: Computational power is exploding, but still not enough to accomplish anyone’s goals. Organizing a computer program is basically an economics problem: managing scarce resources such including CPUs, RAM, GPUs, and communication across processors. Economics VERSUS computational mathematics.Introduction
Lecture 2:
Computer Arithmetic
Chapter 2. Computer arithmetic is not perfect. We examine general concepts of computational errors, and rates of convergence. We use finite – difference derivatives to explore the limitations of finite-precision arithmetic.Computer arithmetic
Lecture 3:
Linear Algebra and Equations
Chapter 3. Many numerical methods reduce to solving a sequence of linear systems of equations. LU, QR, and Cholesky decomposition are the standard direct computational methods. Iterative methods include Gauss-Jacobi and Gauss-Seidel methods. We define the general notion of a condition number.Linear algebra and equations
Lecture 4:
Unconstrained Optimization
Chapters 4 and 5. The basic methods for unconstrained optimization are search methods, bisection, gradient descent, Newton’s method, and derivative free optimization (DFO) methods. Applications to consumer demand, life-cycle problems, and maximum likelihood estimation.Unconstrained optimization

Lecture 5:
Nonlinear Equations
Chapters 4 and 5. Bisection, Newton’s method, BFGS and DFP updates, and Powell hybrid are the basic methods for solving nonlinear equations. Applications to general equilibrium and Nash equilibrium.Nonlinear equations
Lecture 6:
Constrained optimization theory and methods
Chapters 4 and 5. The typical problem in economics includes constraints. The basic theory is given by the Karush-Kuhn-Tucker (KKT) conditions. Linear programming uses both simplex and interior point methods. General nonlinear optimization methods include augmented lagrangian, SQP and interior point methods.Constrained optimization: theory and methods

Lecture 7:
Constrained optimization applications
We often want to evaluate the tradeoffs among alternative actions. This is the subject of multiobjective optimization which aims to construct Pareto frontiers of decisions. Applications to consumer demand and incentive problems.Constrained optimization: applications

Lecture 8:
Structural Estimation I
Estimating values of parameters in structural models requires solving optimization problems, constrained and unconstrained, including maximum likelihood and moments estimators. Nested fixed point (NFXP) is a low-memory method whereas the MPEC approach takes advantage of modern hardware and algorithm advances.Structural estimation I
Lecture 9:
Finite-difference ODEs
Many economics problems lead to solving ordinary differential equations. We examine the standard finite-difference methods.Finite-difference ODEs
Lecture 10:
Version Control Using Git
(Robert Erbe and Gregor Reich)Version control using Git
Lecture 11:
Automatic Differentiation
(Philipp Mueller); includes CasADi TutorialAutomatic Differentiation
Lecture 12:
Homotopy
(Philipp Mueller and Karl Schmedders) Chapter 5. Homotopy methods convert nonlinear equation problems into path-following problems that take one from some simple starting point and goes to the solution. Applications will include general equilibrium.Homotopy
Lecture 13:
Approximation I
Chapter 6. Interpolation, regression, orthogonal polynomials, splines, least squares, LAD and Lasso fits.Approximation I
Lecture 14:
Numerical quadrature MC qMC
Chapter 7, 8, and 9. Computing the expectation of a function requires integration. We examine classical integration methods for single- and multiple-dimensional integrals. Monte Carlo simulation methods are often used, but quasi-Monte Carlo methods are far better asymptotically. Applications to portfolio choice and dynamic problems.Numerical quadrature, MC, qMC
Lecture 15:
Dynamic optimization equilibrium NLCEQ
Macroeconomic models often approximate deterministic dynamic models and then use the equilibrium decision rules to simulate stochastic models. We instead solve the deterministic model globally and use the results to construct a global solution for the decision rules.Dynamic optimization, equilibrium, NLCEQ
Lecture 16:
Dynamic programming-discrete state
Chapter 12. Dynamic economic problems lead to dynamic programming problems. We first examine methods for problems with a finite number of states, including value function iteration, policy iteration, and acceleration methods.Dynamic programming – discrete state
Lecture 17: Structural estimation IISu-Judd and Skrainka-Judd papers.
Structural estimation II
Lecture 18: Dynamic programming-continuous stateChapter 12. Solutions to deterministic and stochastic dynamic programming problems using approximation, integration, and optimization methods. Applications to savings-consumption problems, climate change policy, and portfolio problems.
Dynamic programming – continuous state
Lecture 19: Projection methods IChapter 10, 11, and 17. Methods for solving ordinary differential equations as well as the more complex equations arising in dynamic economic models.Projection methods I
Lecture 20: Projection Methods IIChapter 10, 11, and 17. Methods for solving ordinary differential equations as well as the more complex equations arising in dynamic economic models.Projection methods II
Lecture 21: Perturbation methodsChapter 13, 14, and 15. Taylor series approximations to find numerical solutions of equations, linearizing around a steady state, simple bifurcation methods.Perturbation methods
Lecture 22: Modern ApproximationNeural nets, radial basis functions, machine learningApproximation II
Lecture 23: Dynamic GamesDiscrete states games, nonlinear complimentarity problemsDynamic games
Lecture 24: Multi Objective OptimizationOptimal taxationMultiobjective optimization
Lecture 25: Structural estimation IIIPhilipp Mueller and Gregor Reich guest lecture. Structural estimation III
Lecture 26: DSICEOptimal Carbon Policy with Business Cycle and Climate RisksDSICE: High-Power Computing Applied to Climate Policy Issues
Lecture 27: Concluding remarksFuture of computational economicsConcluding remarks

Contact

If you have any questions, feel free to contact Ken.