Skip to content

[phillips] Correct, connect, and extend the Phillips Curve Tradeoffs lectures - #1105

Merged
mmcky merged 11 commits into
mainfrom
nov_penn2
Nov 3, 2026
Merged

mmcky merged 11 commits into
mainfrom
nov_penn2

Conversation

@mmcky

@mmcky mmcky commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Review and revision of the Phillips Curve Tradeoffs suite, checked against The Conquest of American Inflation and the papers it draws on (Cho, Williams and Sargent 2002; Sargent and Williams 2005; Cogley and Sargent 2005; Sargent and Williams 2025/26; Abreu, Pearce and Stacchetti 1990).

Structure

  • New lecture phillips_policy_evaluation on Conquest chapter 9: maximum likelihood estimation of the classical and Keynesian adaptive models
  • phillips_drifts_volatilities split; the post-2000 update is now phillips_drifts_volatilities_2
  • phillips_lost_conquest moved to the end of the suite

Shared across the suite

  • One escape story: Sims and Chung escape once and stay; Sargent (1999) and CWS recur; Sargent and Williams (2005) explain the difference by the prior; escapes are frequent at the gains the suite uses
  • The E-stability eigenvalue -1/(1+theta^2) made explicit in 98, 102, 103, 105
  • Links to the Bounded Rationality suite, ls_learning, kalman, rational_expectations, markov_perf, and the advanced series, with reverse links from ls_learning, kalman, and rational_expectations
  • Rewritten notation and gain tables; MarcetSargent1989jet citation key; direct FRED CSV reads; 20 new bibliography entries

Corrections that change results

  • Discounted Riccati cross term in phillips_learning and phillips_lost_conquest
  • Kalman-filter normalization and the Sims replication in phillips_priors
  • Both incentive constraints for Abreu's stick and carrot, the worst-value feasibility check, and the APS starting-set condition
  • Better-than-Nash outcomes of optimal misspecified beliefs shown to vanish as the perceived root goes to one
  • Vector field of phillips_escaping_nash (the moment matrix lags)
  • Escape-route persistence prediction, an exact longer MCMC chain, and Monte Carlo error in phillips_drifts_volatilities
  • Real-time data and the January 2026 propositions in phillips_lost_conquest
  • Data statements, figures, and the October 2025 gap in phillips_two_stories

Exercises: about fifty, up from 21, many linking lectures

…lectures

Review and revision of the Phillips Curve Tradeoffs suite, checked against
The Conquest of American Inflation and the papers it draws on (Cho, Williams
and Sargent 2002; Sargent and Williams 2005; Cogley and Sargent 2005;
Sargent and Williams 2025/26; Abreu, Pearce and Stacchetti 1990).

Structure
- New lecture phillips_policy_evaluation on Conquest chapter 9: maximum
  likelihood estimation of the classical and Keynesian adaptive models
- phillips_drifts_volatilities split; the post-2000 update is now
  phillips_drifts_volatilities_2
- phillips_lost_conquest moved to the end of the suite

Shared across the suite
- One escape story: Sims and Chung escape once and stay; Sargent (1999) and
  CWS recur; Sargent and Williams (2005) explain the difference by the prior;
  escapes are frequent at the gains the suite uses
- The E-stability eigenvalue -1/(1+theta^2) made explicit in 98, 102, 103, 105
- Links to the Bounded Rationality suite, ls_learning, kalman,
  rational_expectations, markov_perf, and the advanced series, with reverse
  links from ls_learning, kalman, and rational_expectations
- Rewritten notation and gain tables; MarcetSargent1989jet citation key;
  direct FRED CSV reads; 20 new bibliography entries

Corrections that change results
- Discounted Riccati cross term in phillips_learning and phillips_lost_conquest
- Kalman-filter normalization and the Sims replication in phillips_priors
- Both incentive constraints for Abreu's stick and carrot, the worst-value
  feasibility check, and the APS starting-set condition
- Better-than-Nash outcomes of optimal misspecified beliefs shown to vanish
  as the perceived root goes to one
- Vector field of phillips_escaping_nash (the moment matrix lags)
- Escape-route persistence prediction, an exact longer MCMC chain, and Monte
  Carlo error in phillips_drifts_volatilities
- Real-time data and the January 2026 propositions in phillips_lost_conquest
- Data statements, figures, and the October 2025 gap in phillips_two_stories

Exercises: about fifty, up from 21, many linking lectures

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 3, 2026 01:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

🟡 Changes recommended

The change still has unresolved findings, notably a numerically fragile np.log(np.linalg.det(V)) usage for covariance matrices and a small wording/line-break issue in the prose, so it needs updates before approval.

2 open issues
What changed in this PR

This pull request revises and extends the Phillips Curve Tradeoffs lecture suite, adds a new econometric policy-evaluation lecture grounded in the cited inflation-learning literature, and updates cross-links, ordering, and bibliography support across adjacent learning / bounded rationality material.

Changes:

  • Adds phillips_policy_evaluation (maximum-likelihood estimation and policy-evaluation reconstruction; classical vs Keynesian identification) and integrates it into the suite structure.
  • Expands and clarifies the self-confirming, misspecification, credibility, and adaptive-learning lectures (definitions, E-stability details, derivations, figures, and a substantial increase in exercises).
  • Updates navigation and references (TOC restructuring, additional cross-links/anchors, and new bibliography entries).

Outstanding review items to address before approval:

  • lectures/phillips_policy_evaluation.md: make FRED CSV parsing more robust (avoid brittle series_id column indexing; handle “.” missing values consistently).
  • lectures/phillips_policy_evaluation.md: replace np.log(np.linalg.det(V)) with np.linalg.slogdet (and guard against non-positive determinants) for numerical stability.
  • Minor wording/typos in lectures/phillips_credibility.md and lectures/prospects_bounded_rationality.md.
File Summary
lectures/​rational_expectations.md Adds a cross-link from fixed-point rational-expectations discussion to the Phillips self-confirming lecture.
lectures/​prospects_bounded_rationality.md Adds an anchor for cross-referencing and refines phrasing around empirical shrinkage results.
lectures/​phillips_self_confirming.md Major expansion: fixed-point framing, uniqueness/E-stability material, refined misspecification discussion, and additional exercises.
lectures/​phillips_policy_evaluation.md New lecture implementing maximum-likelihood econometric policy evaluation using US data, with supporting code/figures and exercises.
lectures/​phillips_misspecified.md Clarifies perceived near-unit-root modeling and refactors related computations/exercises.
lectures/​phillips_credibility.md Strengthens links to learning/bounded rationality and expands learning-rate discussion and exercises (plus a minor typo fix requested).
lectures/​phillips_adaptive.md Adds derivations (steady-state inflation, sacrifice ratio), clarifies key discussion points, and expands exercises.
lectures/​olg_adaptive_money.md Clarifies finite-sample behavior of decreasing-gain learning near the self-confirming equilibrium.
lectures/​ls_learning.md Adds pointers summarizing how the Phillips suite uses least-squares learning machinery.
lectures/​kalman.md Adds cross-links to Phillips lectures that use Kalman filtering / drifting-coefficient models.
lectures/​_toc.yml Inserts the new policy evaluation lecture and updates suite ordering (including the drifts/volatilities split).
lectures/​_static/​quant-econ.bib Adds new bibliography entries and citation keys supporting the expanded lecture suite.

This pull request requires changes.

Review effort: Balanced

Comment thread lectures/phillips_policy_evaluation.md Resolved
mmcky and others added 5 commits November 3, 2026 16:00
phillips_lost_conquest: real_time_gap capped vintage dates at the local
date. ALFRED silently drops a vintage date that is still in the future in
St. Louis, so whenever the run clock is ahead of US Central time (CI
between about 00:00 and 06:00 UTC, or any machine east of the US) and the
newest quarter is less than 45 days old, the lecture fails with
KeyError 'GDPC1_<today>'. Take today's date in America/Chicago instead.

phillips_drifts_volatilities: the nyblom_hansen solution solved a stack of
2x2 systems with a 2-D right-hand side, which NumPy 2 treats as a matrix
rather than a stack of vectors. Use the [..., None] / [..., 0] idiom the
suite already uses elsewhere. Exercise 3's output then matches the text
(critical value 0.731, power 0.10-0.43, size 0.032).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Twenty solution-block cells across ten lectures carried mystnb figure
captions, which the LaTeX builder renders as a figure environment inside
the solution box and rejects with "Not in outer par mode", failing the
PDF step of the preview build. Nothing cross-references these names, so
the plots now render as plain outputs, as in the same change on #1101.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- credible_policies, cpol_ex4 solution: the one-period deviation payoff
  is v^R + G, not v^R + T.
- credible_policies, cpol_ex5 solution: as delta -> 0 both curves return
  to v^N, but the optimal punishment does not become "no harsher than
  Nash reversion". Measured from v^N it still sustains about twice the
  improvement (ratio 1.95 at delta = 0.02, 1.98 at 0.005, from the
  lecture's own solve_aps and nash_reversion_best); a short cell now
  prints the ratio.
- self_confirming, sc_ex3 solution: use the main text's N = 2**14 grid.
  With 2**12 the solution printed largest B(C)/C = 0.21 at delta = 0.97
  where the main text prints 0.311 for the same case; C and nu are
  unchanged.
- escaping_nash: epsilon = 0.0002 is not one of the SW2005 gains (their
  Table 1 stops at 0.001, as en_ex4 lists) and phillips_priors no longer
  uses it; say what it is instead.
- priors: define V* = sigma^2 M^{-1}, the epsilon-free RLS prior that the
  code (V_star) and ppr_ex3 (V = epsilon^2 V*) use.
- lost_conquest: drop "with the Riccati equation solved correctly", which
  refers to an earlier bug the reader never sees.
- two_stories: pin the Baxter-King comparison to 2008-2019. Its window
  currently ends in 2019-09, so the output is unchanged today, but once
  the data run past about 2027 it would take in the 2021-22 surge and
  contradict the sentence describing it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sform

The archived NEWQDATA y3 column is exactly i/(400 - i) for the TB3MS
first-month rate i (max error 2.3e-16 over all 211 quarters), the
quarterly return on a bill bought at a discount of i/400 of face value,
not log(1 + i/400) (max error 2.2e-3) as the text said.

- Part 1: describe the transform correctly, and recover i in the data
  figure as 400 y3/(1 + y3). The 400 expm1(y3) used before overstated
  rates by up to about 0.9 percentage points in the early 1980s. No
  estimate changes.
- Part 2: build the post-2000 extension with the same i/(400 - i), so
  the splice no longer changes definition at 2001Q1 (log1p understated
  the new quarters by up to about 2.5 basis points a quarter) and the
  text's "the transformations are unchanged" is true; plot it the same
  way. Because the effective sample size of tr(Q) is only about 9, this
  small data change moves the printed posterior summaries about as much
  as a new seed or a new quarter of FRED data does (posterior mean of
  tr(Q) 0.433 -> 0.318, 1970s peak of core inflation 16.6 -> 23.6
  percent). Every statement in the text still holds in the new run,
  since the text quotes only features that are stable across seeds.
- Both parts: integrated_autocorrelation_time fell over with an
  IndexError when no lag satisfies Sokal's window condition, which
  happens once the autocorrelation time exceeds about a fifth of the
  chain. Fall back to the last lag instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- policy_evaluation: use np.linalg.slogdet in the concentrated log
  likelihood (Copilot).
- prospects_bounded_rationality: "shrank ... by a factor of about fifty",
  with the broken line rejoined (Copilot).
- lost_conquest: pass sort=True to the pd.concat of the FRED series.
  Under pandas 3 the default emits a Pandas4Warning into the rendered
  output; sort=True keeps today's sorted union. It is the only concat in
  lost_conquest, two_stories or policy_evaluation that warns under
  pandas 3.1.
- lost_conquest: IID rather than i.i.d., as elsewhere in the suite.
- Split eight multi-sentence paragraphs (adaptive, drifts_volatilities_2,
  escaping_nash, lost_conquest, misspecified, priors) into one sentence
  per paragraph.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mmcky

mmcky commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Review summary

I reviewed the whole PR: I re-derived the corrections, executed all 13 lectures, and checked the prose against the outputs. Every item under "Corrections that change results" checks out:

  • The discounted Riccati cross term now matches quantecon.LQ to about 1e-13; main's version was wrong.
  • The Kalman normalization is correct.
  • Both stick-and-carrot incentive constraints are correct.
  • The ρ → 1 result is correct.
  • The moment-matrix lag in the vector field is correct.
  • The E-stability eigenvalue −1/(1+θ²) is correct.

The preview build failed for three reasons. All three are now fixed on the branch, together with some smaller corrections:

Commit What it does
1f78c91 Fixes the two execution failures. In phillips_lost_conquest, real_time_gap asked ALFRED for a vintage dated today in local time; ALFRED silently drops a date that is still in the future in St. Louis, so CI failed with a KeyError between about 00:00 and 06:00 UTC. In the phillips_drifts_volatilities Exercise 3 solution, NumPy 2 rejects a stacked np.linalg.solve call.
76b7535 Drops the mystnb figure captions from 20 plots inside exercise solutions. These broke the PDF build ("Not in outer par mode"), as on #1101. None of them were cross-referenced.
8a8bced Seven corrections, listed below the table.
edbf16d phillips_drifts_volatilities: the archived interest rate is exactly i/(400 − i), not log(1 + i/400), and the text, both plots and the post-2000 splice now match it. Also, the autocorrelation-time helper no longer raises an IndexError on a short chain.
4d8ee89 Copilot's two suggestions (slogdet, and "by a factor of about fifty"); sort=True on the one pd.concat that warns under pandas 3; IID in place of i.i.d.; eight multi-sentence paragraphs split.

The corrections in 8a8bced:

  • cpol_ex4: v^R + T → v^R + G.
  • cpol_ex5: the solution claimed the optimal punishment becomes "no harsher than Nash reversion" as δ → 0. It actually stays about twice as effective (ratio 1.95 to 1.98), and a cell now prints the ratio.
  • sc_ex3: now uses the main text's N = 2**14 grid. The coarser grid printed B(C)/C = 0.21 where the main text prints 0.311.
  • phillips_escaping_nash: corrects the attribution of ε = 0.0002.
  • phillips_priors: corrects the definition of V*.
  • phillips_lost_conquest: removes a leftover remark about the Riccati fix.
  • phillips_two_stories: pins the Baxter–King window to 2008–2019, so it cannot drift into the 2021–22 surge as the data update.

Verification. All 13 lectures execute cleanly at the new head in the quantecon environment (NumPy 2.3). The slowest are phillips_drifts_volatilities, at about 7 minutes locally, and phillips_drifts_volatilities_2, at 4 to 6. Apart from the intended changes, outputs are identical to the pre-fix run. phillips_lost_conquest, phillips_two_stories and phillips_policy_evaluation also run under pandas 3.1 without warnings.

A side effect in phillips_drifts_volatilities_2. The splice fix moves its printed posterior summaries a lot; for example, the posterior mean of tr(Q) goes from 0.433 to 0.318. The cause is that the effective sample size of tr(Q) is only about 9. Every statement in the text still holds, because the text quotes only features that are stable across seeds. The tables will also move with each new quarter of FRED data, though. This is item 8 in the follow-up issue.

Follow-up issue. The judgment calls about the economics and framing are collected for Tom in #1106 rather than changed here. They include:

  • the flat/steep convention, which affects the Bernanke contrast in phillips_lost_conquest;
  • the Pivetta–Reis characterization;
  • the discount-factor verdict in phillips_learning;
  • seven smaller items.

Left as is. Style-checker flags that main breaks just as often (figsize, lw=, caption length), and the ASCII phi/gamma names in the phillips_lost_conquest and phillips_policy_evaluation code.

🤖 Generated with Claude Code

mmcky and others added 4 commits November 3, 2026 16:44
With bibtex_reference_style author_year, a bare {cite} renders as a
bracketed parenthetical, so in-text uses read as "[Phelps, 1967]
formulated a control problem" or "chapter 7 of [Sargent, 1999]" (as on
the live site today). Switch the 89 narrative uses across 13 lectures to
{cite:t}, which renders "Phelps [1967] formulated" and "chapter 7 of
Sargent [1999]" (qe-ref-001).

Kept as {cite}: end-of-clause citations and citations that follow an
author's name written out in the prose ("Robert Solow and James Tobin
{cite}`...`"). The parenthesized list of three separate citations in
escaping_nash is now one {cite} with three keys, so it no longer renders
nested brackets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… suite

The bibliography style sentence-cases article titles, so capitals not
protected by braces are lowercased on the references page: today it
prints "The post-war U.S. phillips curve" and "Evolving post-world war
II U.S. inflation dynamics". Brace the proper nouns in the eleven titles
cited by the phillips lectures where this happens (Phillips, Great
Inflation, Great Moderation, World War II, French Revolution, American),
and brace the quoted paper titles inside the Sims, Stock and Taylor
comments so they keep their own capitalization.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Six main-text figures printed the same text twice: once as a matplotlib
title or suptitle inside the image and again as the mystnb caption below
it (qe-fig-003). Remove the embedded title in two_stories, credible_policies
(two figures), escaping_nash (two) and learning. The one that also named
the book's figures moves that reference into its caption.

Kept on purpose: the two_stories titles that carry the book's figure
numbers ("Figure 1.1: ..."), because the prose refers to the plots by
those numbers, and panel titles in multi-panel figures, which label the
panels rather than repeat the caption.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ators

- lost_conquest: phi_pi, phi_pi_riccati and the phi_0/phi_pi/phi_x/phi_i
  rule columns become φ_π, φ_π_riccati and φ_0/φ_π/φ_x/φ_i, matching the
  ρ, κ, λ_x, β already in the same signatures (qe-code-002).
- policy_evaluation: gamma_of_beta becomes γ_of_β.
- \mathbb E -> \mathbb{E} (lost_conquest), and \operatorname{var}(.) ->
  \mathbb{V}[.] (credibility, drifts_volatilities_2, lost_conquest) and
  \operatorname{Prob} -> \mathbb{P} (escaping_nash, learning), the forms
  the rest of the suite already uses.

Outputs of lost_conquest and policy_evaluation are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mmcky

mmcky commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Style-guide pass

A follow-up pass against the QuantEcon style guide added four commits on top of the fixes in the summary above:

Commit What it does
66a32e5 Uses {cite:t} for 89 citations that are part of the sentence. With the author_year style, a bare {cite} renders as a bracket, so the live site reads "[Phelps, 1967] formulated a control problem" and "chapter 7 of [Sargent, 1999]"; these now read "Phelps [1967] formulated" and "chapter 7 of Sargent [1999]". End-of-clause citations, and citations after an author named in the prose, stay as {cite}.
7ca702b Braces the proper nouns in 11 bibliography titles. The references page sentence-cases article titles, so today it prints "The post-war U.S. phillips curve" and "post-world war II"; Phillips, Great Inflation, Great Moderation, World War II, French Revolution and American now keep their capitals, as do the paper titles quoted inside the Sims, Stock and Taylor comments.
973d488 Drops six embedded plot titles that repeated the figure caption below them. The two_stories titles that carry the book's figure numbers stay, because the prose refers to the plots by those numbers.
371f37a Renames phi_pi to φ_π and gamma_of_beta to γ_of_β in code, and uses \mathbb{E}, \mathbb{V} and \mathbb{P}, as the rest of the suite already does.

The six lectures whose code changed run cleanly, with outputs unchanged. Both of Copilot's inline comments were addressed in 4d8ee89 and have replies, so they can be resolved.

Left as is: figure size, line width and caption length, which main breaks just as often; and the "Lucas Critique" / "Lucas critique" spelling, which varies across the suite.

🤖 Generated with Claude Code

@mmcky

mmcky commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

thanks @thomassargent30

For some hours after midnight in St. Louis, ALFRED still treats today's
date as in the future and returns its latest vintage under yesterday's
label, so looking up today's column raised a KeyError. The preview for
371f37a failed this way at 00:34 and 00:45 Central time. Capping the
latest vintage at yesterday requests the same data ALFRED is serving,
and the printed outputs are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mmcky
mmcky merged commit 4d82fff into main Nov 3, 2026
2 checks passed
@mmcky
mmcky deleted the nov_penn2 branch November 3, 2026 08:35
mmcky added a commit to QuantEcon/lectures that referenced this pull request Nov 5, 2026
QuantEcon/lecture-python.myst#1105 added Sims1982 to intermediate's
bibliography without the DOI that advanced's copy has, so tools/bib-merge
refused the key, kept the committed entry (advanced's) and turned the
2026-11-04 nightly's bibliography job red. This rules it as
SmetsWouters2007 is ruled: one copy has more fields, and advanced's adds
the DOI. The seal is the one `tools/bib-merge --propose` printed. The
merged file's entries are unchanged; only its header's rulings digest
moves, and the check is clean with 60 rulings. Part of
QuantEcon/project-monorepo#10.


Claude-Session: https://claude.ai/code/session_01WT8bMXcpeiNdBg6ekmYJWp

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants