phillips_priors#

  • Series: lecture-python.myst

  • File: lectures/phillips_priors.md

  • Audit date: 2026-08-26

  • Corpus snapshot: e25fdf2345

  • Categories audited: writing, math, code, figures, references, links, admonitions (JAX out of scope)

  • Overall score: 7.5 / 10

  • Priority: LOW

Score breakdown#

Category

Score

One-line note

Writing

4.5/10

qe-writing-002 ×5; qe-writing-005 ×3; qe-writing-003 ×4, +2 more.

Math

7/10

qe-math-010 (proposed) ×2; qe-math-009 ×4.

Code

8.5/10

qe-code-001 ×3.

JAX

out of scope

JAX rules target lecture-jax.

Figures

5.5/10

qe-fig-003 ×3; qe-fig-004 ×4; qe-fig-005 ×1, +2 more.

References

7/10

qe-ref-001 ×12.

Links

10/10

no mechanical violations detected.

Admonitions

10/10

no mechanical violations detected.

Issues#

Critical#

None found.

High severity#

  • [qe-fig-001] — Do not set figure size unless necessary. Count: 5. Lines: 328, 366, 397, 553, 655. Example: figsize=.

  • [qe-math-010 (proposed)] — Blackboard \mathbb{P}, \mathbb{E}, \mathbb{V} with braces. Count: 2. Lines: 161, 189. Example: non-blackboard \operatorname{cov}.

  • [qe-ref-001] — Use correct citation style. Count: 12. Lines: 40, 57, 103, 182, 444, 446, 448, 587, 599, 668. Example: {cite} in narrative flow: ‘of {cite}’.

  • [qe-writing-002] (reviewer) — Keep writing clear, concise, and valuable. Count: 5. Lines: 219, 40, 438, 587, 615. Example: the file is otherwise well-paced - one sentence per paragraph, no qe-writing-001 hits at all - and the cost is concentrated in five long sentences. 219 is 63 words carrying three equation references and two definitions (“Constant-gain recursive least squares is the special case in which the government’s prior is \(V = V^* \equiv \epsilon^2\sigma^2 M(\bar\gamma)^{-1}\) and \(\sigma = \sigma_1\); then {eq}`pp_riccati` gives … and {eq}`pp_kalman` reduces to … with gain \(\epsilon\)”) - the sentence that establishes the link to the previous lecture is the hardest one in the file to read. 40 is 39 words and four references; 438 is 40 words with a parenthesis nested inside an em-dash aside; 587 is 57 words ending in an appositive that names another lecture; 615 is 45 words. Splitting each at its semicolon or dash would cost nothing.

Medium severity#

  • [qe-code-001] (reviewer) — Follow PEP8 unless closer to mathematical notation. Count: 3. Lines: 267, 472, 560. Example: flake8 (90-character limit) finds two things in the whole file and both are real: 267 puts two statements on one line with a semicolon, gp[j] += h; gm[j] -= h (E702), the only semicolon in the lecture; and 560 is 95 characters. The third item is a naming one a linter cannot see: effective_gain (467-472) returns (P @ Φ)[0] / (σ_govt**2 + Φ @ P @ Φ), the first component of the Kalman gain vector, under a name that promises the gain - the number printed at 476 and quoted at 479 (“multiplies the effective gain by more than twenty”) is the intercept’s gain, not the gain. gain_intercept would say what it is. Otherwise the code matches the algebra unusually closely: Unicode Greek throughout (γ, σ1, σ2, ε, λ, Φ, Λ absent only because the drift is never simulated), γ_sce, M_sce, V_star, P_star all named after their symbols, and no long lines apart from 560.

  • [qe-fig-003] — No matplotlib embedded titles. Count: 3. Lines: 372, 379, 564. Example: .set_title.

  • [qe-fig-004] — Caption formatting conventions. Count: 4. Lines: 307, 359, 390, 544. Example: caption of 10 words.

  • [qe-fig-008] — Use lw=2 for line charts. Count: 4. Lines: 329, 398, 656, 657. Example: plot() without lw=.

  • [qe-math-009] (reviewer) — Choose simplicity in mathematical notation. Count: 4. Lines: 419, 219, 187, 115. Example: four places where a symbol could simply be dropped. (1) \(Q(\bar\gamma, \bar P) = \hat V\) at 419 gives two new names to an object the lecture has called \(V\) for two hundred lines and the sentence itself calls “the prior itself”; 677 then uses \(\hat V\) again in the exercise. Writing \(V\) would be shorter and correct. (2) The gain is \epsilon at 219 (three times, including \(V^* \equiv \epsilon^2 \sigma^2 M(\bar\gamma)^{-1}\)) and \varepsilon at 480 and 482 - the same parameter in two different glyphs, which render as visibly different characters, and the code calls it ε (320) and ε_common (474). (3) \(\Lambda_n\) is the drift innovation at 187 and \(\lambda\) is the prior-tightening parameter from 297 onward, so upper- and lower-case lambda name unrelated objects in one file; λ in the code (314-326, 343, 650) is only ever the second. (4) 115 introduces \(\hat{\mathbb{E}}\) for the government’s subjective expectation, uses it once, and never explains the hat - the only decorated operator in a file that otherwise writes \(\mathbb{V}\) and \(\operatorname{cov}\) plainly (161, 189).

  • [qe-writing-003] (reviewer) — Maintain logical flow. Count: 4. Lines: 419, 129, 541, 153. Example: (1) The section that carries the lecture’s cleanest result introduces two undefined symbols in one sentence. 419 reads “it is the eigenvector associated with the largest eigenvalue of the belief-innovation covariance \(Q(\bar\gamma, \bar P) = \hat V\) - the prior itself”: \(Q\) appears here and nowhere else in the file, \(\hat V\) appears only here and at 677, and neither is defined, so the reader cannot tell whether \(\hat V\) is \(V\), \(\sigma^{-2}V\) or something else - while the code two lines later simply uses V_star (422). (2) StaticPhillips.__init__ hard-codes self.σ = σ1 with the comment # govt regression error std = σ1 (129), i.e. the class asserts the government has the variance right - and the whole of §“Sims’s nonconvergence” (440-480) is about the case where it does not. effective_gain and simulate therefore take a separate σ_govt argument (467, 487) while V_star (230), P_star (231) and every solve_riccati call outside them (325, 345, 652) keep using model.σ. Nothing says whether the baseline prior is meant to be held fixed across the two specifications. (3) 541-542 says “Three seeds make the point without any cherry-picking: seed 0 never escapes, seed 4 escapes repeatedly and is pulled back each time, and seed 6 escapes and stays away for a long spell” - but the figure at 551-568 plots all three seeds in both panels, so it never says which specification each description belongs to, and the per-seed narrative sits awkwardly beside 538’s claim that under Sims’s misallocation “every path escapes”. (4) Belief 3 is named at 153 (“in a dynamic version, coefficients on current and lagged inflation summing to zero”) and never used again; the lecture is static throughout, as 59 says, so the third of the three “belief vectors worth naming” is content the reader has to carry and never spend.

  • [qe-writing-004] — Avoid unnecessary capitalization in narrative text. Count: 1. Lines: 615. Example: mid-sentence ‘Inflation’.

  • [qe-writing-005] (reviewer) — Use bold for definitions, italic for emphasis. Count: 3. Lines: 289, 59, 338. Example: the file’s convention is clear and almost always followed - bold for definitions (mean dynamics and escape dynamics 50-51, learning cycle 55, prior about parameter drift 194, E-stability 275, stable limit cycle 295) and italic for emphasis (any 48, toward/away 50-51, unstable 55, forever 57, joint 238, general 287, typical/rare 409-411, right 448, too little 456, every 538) - which makes the three deviations stand out. 289 sets an emphatic negation in bold, “the \(P\) block does not decouple”, where 631 writes the identical construction in italic, “does not destabilize the self-confirming equilibrium”. 59 bolds the bare adjective static as emphasis and 90 then bolds static model as a definition, so the same term is bolded twice for two different reasons while 70, 159 and 487 leave it plain. And 338 introduces a named concept in italic - “what {cite}`Bullard1994` calls a learning equilibrium” - which is a definition, not emphasis.

  • [qe-writing-007] (reviewer) — Use visual elements to enhance understanding. Count: 3. Lines: 413, 336, 466. Example: the lecture draws its mean dynamics well and then stops drawing exactly where the geometry gets interesting. (1) §“Escape dynamics and the direction of escape” (413-438) is the section with the prettiest result - the escape direction is the dominant eigenvector of the prior - and its entire output is two print lines (430-431). The figure is already half-built: 375-380 plots belief space with the self-confirming point marked kx, so adding the eigenvector as an arrow from \((2u, -1)\) to \((u, 0)\), with the Ramsey line \(b = 0\), would show the claim rather than assert it, and would let the exercise-2 comparison of two priors (699-702) be drawn on the same axes. (2) The Hopf bifurcation is described at 336-338 and split across two figures that are never combined: 307-333 plots the maximum real part against \(\lambda\), 359-383 plots one cycle at \(\lambda = 0.7\). The standard picture - cycle amplitude against \(\lambda\), going to zero at the bifurcation point - would join them and is a three-line loop over the existing solve_ivp call. (3) The mechanism at 456-464 (understating the error variance inflates the steady-state \(P\) and hence the gain) is quantified by exactly two printed numbers at 474-476; the effective gain plotted against \(\sigma\) over \([\,0.05, 0.5\,]\), with \(\sigma_1\) marked, would carry it in one panel.

Low severity#

  • [qe-fig-005] — Descriptive figure names for cross-referencing. Count: 1. Lines: 642. Example: code-cell figure without mystnb figure metadata.

Strengths#

  • The {warning} at 100-113 is the single most useful block in the file: it records that the sibling lecture {doc}`phillips_escaping_nash` orders the belief vector the other way round, gives the exact translation (\(a = \gamma_{-1}\), \(b = \gamma_1\), \((2u,-1)\) here is \((-1, u(1+\theta^2))\) there with \(\theta = 1\)) and notes that \(M\), \(V\) and \(P\) transpose correspondingly - a coordinate clash between two lectures in the same suite, declared rather than left to bite.

  • The self-confirming equilibrium is derived by hand in three lines (161-163: slope \(= \operatorname{cov}(U,\pi)/\mathbb{V}[\pi] = -1\), then \(a = u + x(\bar\gamma)\) with \(x = a/2\), so \(a = 2u\)) and then checked numerically in the next cell, where 171 prints g_bar(γ_sce) to confirm it is zero.

  • The link to the previous lecture is verified rather than asserted: 219 claims that the RLS prior \(V^* = \epsilon^2\sigma^2 M(\bar\gamma)^{-1}\) makes the Riccati solution \(P = \epsilon M(\bar\gamma)^{-1}\), and 233 prints np.allclose(P_star, np.linalg.inv(M_sce)) to check it.

  • The closed-form Jacobian at {eq}`pp_jacobian` (254-259) is immediately re-derived numerically by central differences (262-272), so the analytic matrix and the code agree in the output, and 283 then reads one eigenvalue off it (“one of them exactly \(-\tfrac12\), the marginal value that appeared in {doc}`phillips_learning`”).

  • The lecture is careful about what kind of object a disinflation is, and says so in the place where a reader would otherwise conflate the two: 407-411 contrasts the new learning cycle with the escapes of the previous lecture in three sentences (“There, disinflations were rare events … Here the disinflations are a typical feature of the time series … a deterministic cycle that persists even as the gain shrinks to zero”).

  • The Sims puzzle is settled by an experiment designed to isolate one cause: simulate (487-507) takes σ_govt as its only varying argument, 482-484 states the design (“holding \(\varepsilon\) fixed so that the only difference is the variance the government attributes to its own regression error”), and 509-528 then reports mean inflation and time near Ramsey for ten seeds in each specification rather than showing one path.

  • The mechanism behind that result is given before the simulation, not after: 454-464 argues from the Riccati equation alone that a government understating its error variance must attribute the variation to coefficient drift, which inflates \(P\) and hence the gain - and 474-476 then measures the factor.

  • The conclusion goes past the paper being taught and reports the objection to it (591-607): {cite}`Primiceri2006` and {cite}`Sargent2008` on implausibly volatile estimated beliefs, then {cite}`CarboniEllison2009` disciplining the prior with the Fed’s own Greenbook forecasts, with the punchline that shrinking \(V\) by orders of magnitude leaves the low-frequency story intact.

  • Both exercises test the lecture’s own claims rather than adding new material - ppr_ex1 checks the asymmetry asserted at 438 (tightening the intercept prior does not destabilize), ppr_ex2 checks that the escape destination is robust to the prior’s scale but its route is not - and the solution at 705-714 states the result carefully in both directions.

  • Four of the five figure cells carry mystnb caption and name metadata (307-313, 359-365, 390-396, 544-550), which is why qe-fig-005 reports only the exercise-solution cell at 642.