Jorge Jesus Alonso Ortiz

Jorge Jesus Alonso Ortiz

Research, teaching, coding… and dogs

Advanced Macroeconomics

Advanced Macroeconomics · Leer en español →

ITAM · FALL 2026 · JORGE ALONSO-ORTIZ

Advanced Macroeconomics

A course on business cycles: what starts them, how they spread, and what households, firms and governments do about them. Data, econometrics and general-equilibrium models, with the tools used at central banks, consultancies and international organizations.

8

units, each with its slide deck

8

interactive labs in the browser

31

notebooks that open in Colab, in Spanish and English

0

licences: everything in Python with puremacro

Three questions organize the course

WHAT STARTS THEM?

Measure and decompose

National accounts, filters, cycle moments and wedge accounting: what needs explaining before proposing a model.

HOW DO THEY SPREAD?

Identify shocks

SVARs, narrative evidence and local projections, honest about which assumption produces each result.

WHAT DO AGENTS DO?

Model decisions

From the neoclassical model to RBC, from heterogeneous agents and HANK to sticky prices and labor-market search.

Units

Each unit opens with a claim the material defends: the slides argue it, the lab lets you explore it and the notebooks reproduce it with data. Slides are in Spanish.

BLOCK A · GROWTH AND FLUCTUATIONS WITHOUT FRICTIONS

UNIT A1 · WEEKS 1–2

Stylized facts: measuring the cycle

GDP is a revisable construct, and the filter you choose decides the cycle. Kaldor’s facts organize the long run; the labor share and TFP are the ones that are breaking.

Slides 1 (PDF)
Lab: How much of the cycle comes from the filter?
Notebooks in Colab: T01_A · T01_B · T01_C

UNIT A2 · WEEKS 3–4

The neoclassical growth model

Planner and market deliver the same allocation, and the parameters pin down the long run. Solving the model means choosing an approximation: local by perturbation, or global with the value function.

Slides 2 (PDF)
Lab: How fast does an economy reach its steady state?
Notebooks in Colab: T02_A

UNIT A3 · WEEK 5

Risk and uncertainty

Risk is modeled with states of nature, and the full risk sharing that implies is rejected by the data.

Slides 3 (PDF)
Lab: What is lost when an AR(1) becomes a Markov chain?
Notebooks in Colab: T03_A · T03_B · T03_C · T03_D · T03_E · T03_F

UNIT A4 · WEEKS 7–8

Real business cycles and business-cycle accounting

The cycle is summarized by second moments, and a calibrated RBC matches only some of them. Every shock can be quantified, and the wedges point to the equation of the model that fails.

Slides 4 (PDF)
Lab: Can productivity shocks alone explain the business cycle?
Notebooks in Colab: T02_B · T04_A · T04_C

UNIT A5 · WEEKS 9–10

Empirical identification: SVARs, narrative evidence and local projections

Identifying a shock requires an assumption, and the assumption decides the result. Narrative methods and local projections change the identifying assumption; they don’t remove it.

Slides 5 (PDF)
Lab: What does a rate hike do to output?
Notebooks in Colab: T05_A · T05_B · T05_C · T05_D · T05_E · T05_F

UNIT A6 · WEEK 11

Incomplete markets, heterogeneity and HANK

When the aggregate state is a distribution, the multiplier is no longer a free parameter.

Slides 6 (PDF)
Lab: What happens when no one can insure their income?
Notebooks in Colab: T06_A · T06_B · T06_C

BLOCK B · MODELS WITH FRICTIONS

UNIT B1 · WEEKS 13–14

Mechanisms: labor, capital and the small open economy

The macro labor-supply elasticity is produced by aggregation, not by microeconometrics. Variable utilization, adjustment costs and openness account for the part of the cycle that productivity does not.

Slides 7 (PDF)

UNIT B2 · WEEKS 15–16

Non-competitive markets: sticky prices and labor-market frictions

With sticky prices money stops being neutral and the Phillips curve gets a slope. With search frictions unemployment is an equilibrium, not a residual.

Slides 8 (PDF)
Lab: How much output does it cost to bring inflation down?
Lab: Why is there unemployment when there are vacancies?
Notebooks in Colab: T02_C · T02_D · T08_A

Notebooks

Each notebook opens in Google Colab with one click, installs puremacro and downloads only the course folder, not the whole repository. They run on your own computer too.

NotebookTopicOpen in Colab
T00Course map and environment checkES · EN
T01_ABusiness-cycle facts from the labor side: HP, Hamilton, Okun and BeveridgeES · EN
T01_BNational accounts across 49 countriesES · EN
T01_CHigh-frequency indicators and uncertaintyES · EN
T02_ANeoclassical growth: local and global solutionsES · EN
T02_BThe RBC model from a .mod fileES · EN
T02_CThe three-equation New Keynesian modelES · EN
T02_DThe zero lower bound with OccBinES · EN
T02_EBayesian estimation of a DSGE modelES · EN
T02_FMacro-finance: Gertler–KaradiES · EN
T03_AAggregate shocksES · EN
T03_BVolatility: GARCH and DCCES · EN
T03_CGrowth at riskES · EN
T03_DUncertainty indices from textES · EN
T03_EUncertainty with local language modelsES · EN
T03_FCentral-bank narratives with language modelsES · EN
T04_AThe tax multiplier three waysES · EN
T04_CBusiness-cycle accounting: the four wedgesES · EN
T05_ASVAR identificationES · EN
T05_BLocal projectionsES · EN
T05_CStaggered difference-in-differencesES · EN
T05_DLP-DiDES · EN
T05_EGeneralized impulse responses by regimeES · EN
T05_FAn SVAR of post-pandemic inflationES · EN
T06_AWealth inequality: Aiyagari–HuggettES · EN
T06_BLife cycle and demographicsES · EN
T06_CPortfolios and Epstein–Zin preferencesES · EN
T07_AFirm dynamics: HopenhaynES · EN
T08_ALabor flows: Shimer and Mexico’s four-state ENOEES · EN
T09_AValidation galleryES · EN
T09_BBuild your own indexES · EN

ON YOUR COMPUTER

git clone --depth 1 --filter=blob:none --sparse \
  https://github.com/jalonso1979/puremacro
cd puremacro && git sparse-checkout set curso/notebooks
pip install "puremacro[io]>=4.0.1,<5" statsmodels arch jupyterlab
jupyter lab curso/notebooks

DATA AND CREDITS

The notebooks use frozen snapshots from FRED, the OECD, INEGI, ILOSTAT and other public sources, so results reproduce offline. Cite each original publisher; the list is in FUENTES.md. Text and slides: CC BY 4.0; code: MIT.

Calendar

One session a week. Day, time, room and any changes are announced on Canvas, the course’s official channel.

Wk.DatesContentDue
1Aug 10–14National accounts, real-time data and revisions; Hodrick–Prescott and Hamilton filters.—
2Aug 17–21Kaldor facts beyond the US; measuring capital, the labor share, TFP and intangibles; the Beveridge curve.Homework 1 out
3Aug 24–28Neoclassical model: planner, competitive equilibrium, steady state and balanced growth path.—
4Aug 31–Sep 4Log-linearization, simulating .mod models, the Bellman equation and value function iteration.—
5Sep 7–11Arrow–Debreu markets; Tauchen and Rouwenhorst; the endogenous grid method; stochastic volatility and growth at risk.Homework 1 due
—Sep 14–18Mexican Independence week: no session on Wednesday 16.—
6Sep 21–25First midterm (Wednesday 23), units A1–A3.Midterm 1
7Sep 28–Oct 2Real business cycles: Kydland–Prescott moments, the RBC model and its calibration.—
8Oct 5–9Hansen’s indivisible labor; a taxonomy of shocks; Chari–Kehoe–McGrattan business-cycle accounting.Homework 2 out
9Oct 12–16VARs, Cholesky and Blanchard–Quah; the evidence on technology shocks (Galí 1999, Fisher 2006).—
10Oct 19–23Narrative methods, proxy SVARs and monetary shocks (including Banxico announcements); local projections and state-dependent multipliers.Homework 2 due
11Oct 26–30Precautionary saving, Aiyagari–Huggett, the wealth distribution, marginal propensities to consume and HANK.Homework 3 and the AI audit out
12Nov 2–6Second midterm (Wednesday 4), units A4–A5.Midterm 2
13Nov 9–13Labor supply over the cycle: indivisible labor, extensive and intensive margins, home production.Homework 3 due; final project out
14Nov 16–20Variable utilization, adjustment costs and Tobin’s q; the small open economy (Aguiar–Gopinath).Homework 4 out; AI audit due (Fri 20)
15Nov 23–27Monopolistic competition and markups; price rigidity, monetary non-neutrality and the 2021–2023 inflation.—
16Nov 30–Dec 2Mortensen–Pissarides, the Shimer puzzle and the Hosios condition; Mexico’s dual labor market (ENOE, F/I/U/N).Homework 4 due; project presentation
—Dec 7–19In-class theory final (B1–B2) and take-home computational final (A6 and the empirical part).Finals

Grading

ComponentWeight
Four programming homeworks20%
Adversarial audit of AI-generated code10%
Final project10%
First midterm (A1–A3)15%
Second midterm (A4–A5)15%
Theory final (B1–B2)15%
Computational final (A6 and empirical part)15%

HOW WE WORK

All in Python, nothing to license

The course’s models, estimates and figures run on puremacro, a pure-Python library that also reads Dynare .mod files. It works in Colab, on a laptop and even on an iPad.

pip install puremacro

Homework includes an adversarial audit: finding the bugs in code written by an AI. Reading code with suspicion is part of the craft.