Quantitative Macroeconomics with AI and Machine Learning

Zhigang Feng  ·  Professor of Economics

E-mail: z.feng2@gmail.com

Webpage: https://sites.google.com/site/zfeng202/

This course covers how structural macroeconomic models are actually solved and analyzed on a computer. It runs across twelve topics: computation and programming foundations, including Python from scratch; numerical methods for dynamic models — dynamic programming, perturbation, projection, and accuracy assessment; high-performance and parallel computing; machine learning for macroeconomics; and heterogeneous-agent and life-cycle models. The organizing premise is that as AI takes over more of the implementation, the economist's edge moves to designing algorithms and validating results — the Research Architect.

Every lab runs on CPU alone — in GitHub Codespaces or on your own machine — so nothing is gated behind special hardware. In practice the machine-learning topics train noticeably faster on a GPU, so use one if you have access; none of them require it.

Prerequisites and where to go next. The course assumes intermediate macroeconomics — if you would like the theory firmer first, a previous offering of Advanced Macro Theory is recorded in full and free to watch. No programming background is needed: Topic 3, Programming Basics for Economists, teaches Python from scratch. The AI frontier that builds on this — reinforcement learning in depth, language models as economic measurement, and agentic research pipelines — is the companion course, AI for Economic Research: Dynamic Models, Language, and Agents. The two are designed as one sequence: classical methods → machine learning → agentic AI research.

📺 Watch the lectures

This course has a complete video series: nine lectures, about nine and a half hours, recorded at the University of Miami in 2026 and free on Bilibili with no registration. Four earlier series — back to 2024 — cover the same ground at a slower pace.

▶  Watch the 2026 series All recordings, topic by topic

Start here

Three steps per topic

  1. Read the topic in the syllabus — it lists the conceptual content and the hands-on session that goes with it.
  2. Work through the deck from the slides page, or watch the recording if you would rather be talked through it.
  3. Run the lab. The notebooks are where the material becomes yours — every one runs on CPU and is offline-friendly.

Where to enter. New to computation: start at Topic 1 and do the setup lab. Already comfortable with Python and dynamic programming: Topics 7–9 are the classical core, and Topics 5–6 are the bridge to machine learning. Interested only in AI-assisted coding: Topic 3A stands alone. Heading for heterogeneous agents: Topics 11–12 are the destination.

What You Will Build · 四项能力

Four integrated competencies

Course Map · 课程结构

StageFocusTopics
FoundationsAI for research; what quantitative macro needs; Python & PyTorch; AI-assisted coding1–3, 3A
Numerical coreApproximation, optimization, interpolation, discretizing shocks4
Machine learningDeep learning for economists; neural solutions to macro models5–6
Classical methodsDynamic programming, accuracy, perturbation, projection, HPC7–10
HeterogeneityAiyagari and Krusell-Smith with ML; life-cycle OLG models11–12

Topics

Topic 1 · Foundations Artificial Intelligence for Economics Research Slides Available Lab ▶ Video
Topic 2 · Foundations Introduction to Computation for Macroeconomists Slides Available Lab ▶ Video
Topic 3 · Foundations Programming Basics for Economists Slides Available Lab
Topic 3A · Foundations AI Coding for Dynamic Equilibrium Models Slides Available Starter project ▶ Video
Topic 4 · Numerical core Numerical Methods for Macroeconomists Slides Available Lab ▶ Video
Topic 5 · Machine learning Introduction to Machine Learning for Economists Slides Available Labs ▶ Video
Topic 6 · Machine learning Solving Macroeconomic Models Using Machine Learning Slides Available Labs ▶ Video
Topic 7 · Classical methods Numerical Solution Methods for Dynamic Models Slides Available Lab ▶ Video
Topic 8 · Classical methods Advanced Numerical Methods & Accuracy Assessment Slides Available Lab ▶ Video
Topic 9 · Classical methods Perturbation and Projection Methods Slides Available ▶ Video
Topic 10 · Classical methods High-Performance and Parallel Computing Slides Available
Topic 11 · Heterogeneity Heterogeneous Agents Models with Machine Learning Slides Available Lab ▶ Video
Topic 12 · Heterogeneity Heterogeneous-Agent OLG Models Slides Available Lab

Where this course sits

This is the middle of three courses that run as one sequence. Before it, Advanced Macro Theory supplies the models — twenty-eight recorded lectures from the Solow model through recursive optimization, competitive equilibrium, asset pricing, and fiscal policy. After it, the AI frontier — large language models as economic measurement, retrieval-augmented generation, and running a research pipeline with agentic AI — is a course of its own, AI for Economic Research: Dynamic Models, Language, and Agents. This site is where the models get solved, and it is the subject of the textbook 机器学习与数量宏观经济学.

Macro Theory Classical Methods ML & Deep Learning Agentic AI Research

You can enter at any stage. This site is the middle two.

New here? Start with the full syllabus for the topic-by-topic plan, the hands-on sessions, and the reference list.