git clone https://github.com/vonzhg/Macro-2026Fall.git
cd Macro-2026Fall
conda create -n econ282e python=3.11 -y
conda activate econ282e
pip install -r labs/requirements.txt
jupyter lab
Or use any environment that satisfies requirements.txt.
GitHub renders .ipynb files in the browser if you only want to read one.
Posted before Session 3. Installs the tools, verifies the environment, writes a first program, and solves the Solow model against its closed form. Start here if you have never used Python.
Session 3 (Oct 8). Python and NumPy essentials; the
GrowthModel class; VFI and time iteration, both graded against the
Brock–Mirman closed form; convergence and accuracy diagnostics; a dependency-free HP
filter; a first look at autograd. Homework 1 Part A starts from this lab.
Session 4 (Oct 15). A root-finder bake-off with measured convergence orders (1, 1.618, 2); golden section; interpolation shape tests and Smolyak sparse grids; quadrature; Tauchen against Rouwenhorst at ρ = 0.9, 0.95, 0.99; Howard and EGM on the quarterly RBC model; and the deck 4.B4 worked example end to end.
Session 5 (Oct 22). Log-linearization and the QZ solve, with Blanchard–Kahn as an eigenvalue count; the Taylor principle recovered from a New Keynesian model; second order by residual matching, the risk correction and pruning; the Hilbert matrix at condition 3×1018; Chebyshev conditioning and convergence; a collocation solve of the same RBC model; and one model, four methods.
Session 6 (Oct 29). The household problem by EGM and the kink the borrowing limit puts in it; the Young lottery and three routes to the invariant distribution; bisection on r, and why Newton is the wrong tool here; a refinement ladder and Euler residuals reported as a median, with the maximum located; persistence moving the constrained share from 0.5% to 13% with dispersion held fixed; a capital-tax transition solved backward-then-forward; welfare by consumption-equivalent variation, along the path and across steady states; and the complete-markets case where none of it was needed. The solver is inlined from the same code that generated the lecture's numbers.
Session 7 (Nov 5). A sum of shifted ReLUs fitted to
sin x by least squares, and then with the kinks allowed to move
— on a kinked target the learned knot lands on the constraint; the five-line training
loop; backpropagation by hand checked against autograd; the
growth model written as a loss and graded against its closed form; the quarterly RBC graded
on off-sample Euler residuals; and an input-convex network against a plain
one. First lab where a GPU helps — still not needed.
Reinforcement learning; text as data; an agentic research workflow. Posted as each session is built.
pip install -r requirements.txt). Everything runs offline except the FRED
downloads in deck 3.B4 and Homework 1 (Part A, A3), which need an internet connection;
pandas-datareader is an optional alternative to reading FRED's CSV address directly.