phillips_credible_policies#

  • Series: lecture-python.myst

  • File: lectures/phillips_credible_policies.md

  • Audit date: 2026-08-26

  • Corpus snapshot: e25fdf2345

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

  • Overall score: 8.5 / 10

  • Priority: LOW

Score breakdown#

Category

Score

One-line note

Writing

6.5/10

qe-writing-003 ×2; qe-writing-002 ×3; qe-writing-007 ×2.

Math

9.5/10

qe-math-009 ×3.

Code

8.5/10

qe-code-001 ×4.

JAX

out of scope

JAX rules target lecture-jax.

Figures

6/10

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

References

10/10

no mechanical violations detected.

Links

9/10

qe-link-002 ×1.

Admonitions

10/10

no mechanical violations detected.

Issues#

Critical#

None found.

High severity#

None found.

Medium severity#

  • [qe-code-001] (reviewer) — Follow PEP8 unless closer to mathematical notation. Count: 4. Lines: 863, 714, 169, 236. Example: 863 puts import pandas as pd in the middle of the lecture, 750 lines after the import cell at 109-113 that collects the other three (E402), and pandas is then used again at 999 in an exercise solution. 714 is an f-string with no placeholders, print(f"at δ = 0.2:") (F541). Docstring quoting is inconsistent within the file: 455-459 uses a proper triple-quoted docstring while fifteen other functions use a bare one-line double-quoted string (169, 175, 204, 209, 473, 563, 568, 643, 688, 711, 758, 763, 768, 784, 798). And fourteen code lines run past 79 characters (E501): 169, 236, 248, 462, 463, 696, 716, 768, 776, 784, 877, 881, 882, 1046. 708-710 also leaves one blank line before a top-level def where PEP8 asks for two.

  • [qe-fig-001] — Do not set figure size unless necessary. Count: 3. Lines: 235, 816, 1045. Example: figsize=.

  • [qe-fig-003] — No matplotlib embedded titles. Count: 4. Lines: 248, 821, 825, 828. Example: .set_title.

  • [qe-fig-004] — Caption formatting conventions. Count: 2. Lines: 223, 805. Example: caption of 11 words.

  • [qe-link-002] — Use doc links for cross-series references. Count: 1. Lines: 82. Example: raw link to python-advanced.quantecon.org.

  • [qe-math-009] (reviewer) — Choose simplicity in mathematical notation. Count: 3. Lines: 409, 243, 423. Example: \(B\) is two different objects in the same section. 133-135 defines \(B(x)\) as the government’s one-period best response and the lecture uses it that way throughout (433 “\(\eta = B(y)\)”, 445, 507, 521, 549, 616, 684). Then 409 says “Let \(B(W)\) collect the \(w\) components of all admissible pairs”, and 423-426 works with that \(B\) - “\(B\) maps compact sets into compact sets”, “\(B\) is monotone”, “\(W_j = B(W_{j-1})\)”, “\(V = B(V)\)” - while 433-445, twenty lines later, is back to the best response. The code keeps them apart (B at 174, B_operator at 454) and the math does not; the APS operator is conventionally \(\mathcal{B}\) or \(T\), and either would cost nothing. Second, the worst equilibrium value has two names: \(\underline v\) everywhere in the prose and displays (505, 514, 521, 748, 874, 1093, 1128, 1133) but \(v_{min}\) in both figures - the annotation at 243 and the suptitle at 828-829 - so the only place a reader meets the symbol visually is the one place it is spelled differently. Third, \(V\) is the set of SPE values at 423, 426 and 1023, while \(V^g\) is the value functional at 148, 294 and 303; the two are separated by a superscript alone and appear 130 lines apart.

  • [qe-writing-002] (reviewer) — Keep writing clear, concise, and valuable. Count: 3. Lines: 253, 423, 340. Example: 253-254 says the wrong thing about the figure it annotates: “The vertical gap between the curves is the government’s one-period temptation to inflate less than expected.” The gap is \(r(y, B(y)) - r(y, y)\), the gain from deviating, and the direction of the deviation flips at the Nash rate. With the lecture’s own parameters (\(\theta = 1.25\), \(U^* = 5.5\), so \(y^N = 6.875\)), \(B(0) = 2.68 > 0\): at the Ramsey point marked \(v^R\) on that same figure the temptation is to inflate more than expected, and at \(y^\# = 10\), \(B(10) = 8.78 < 10\), so there it is to inflate less. The next sentence (256-257) is the one that is true - “it widens as expected inflation rises above the Nash rate” - so the paragraph describes only the right-hand half of a figure that spans \([0, y^\#]\), and the half it misdescribes is the half the Barro-Gordon argument at 626-658 depends on. Separately 423-426 puts four distinct theorems in one 58-word sentence (largest self-generating set, compactness preservation, monotonicity with its parenthesised statement, and monotone convergence from any \(W_0\) with \(B(W_0) \subseteq W_0\)), and 340-343 is 55 words with three subordinate clauses.

  • [qe-writing-003] (reviewer) — Maintain logical flow. Count: 2. Lines: 533, 462. Example: two terms are used in section titles long before they are defined. {prf:proposition} cp_prop_worst at 533 is titled “The worst SPE is self-enforcing” and cp_prop_best at 555 “The best SPE is self-rewarding”; the definition that gives those words meaning, {prf:definition} cp_selfenf, arrives at 726-732, 193 and 171 lines later. The bodies of the two propositions do spell out what they mean, which softens it, but 737-738 then reaches back up to them from below the definition (“{prf:ref}`cp_prop_worst` and {prf:ref}`cp_prop_best` say that these two structures are not curiosities”) - which is the order that would have worked if the definition had come first. Second, the source text’s own numbering leaks into a lecture that otherwise labels everything itself: the comment at 462 says # equation (10) where the lecture’s label for that display is cp_bound (443), and the two figure titles at 248 and 828 announce “Figure 4.1” and “Figures 4.2-4.4”, which are numbers in chapter 4 of {cite}`Sargent1999` and not in this lecture, whose figures are fig-cpol-schedules and fig-cpol-three-methods.

  • [qe-writing-007] (reviewer) — Use visual elements to enhance understanding. Count: 2. Lines: 489, 432. Example: the lecture’s whole claim to novelty is that APS iterate on sets rather than values (72-75: “APS iterate an operator that maps sets of continuation values into sets of values”), and the iteration itself is never drawn - it is reported as one line of text, “converged in 534 iterations” (489-491). One picture of \(W_0 \supset W_1 \supset W_2 \supset \cdots \to V\) as a stack of shrinking intervals, or the two endpoints against iteration number, would make the set-valued operator concrete in a way no other figure in the lecture does; the fixed point is plotted against \(\delta\) in exercise 2 (1037-1055) but the approach to it never is. Second, 432-434 asserts the simplification the whole computation rests on - “the constraint in {prf:ref}`cp_admissible` binds hardest at \(\eta = B(y)\), so we may replace “for all \(\eta\)” by that single deviation” - and the payoff-schedule figure at 223-250 draws only the one-period halves of that comparison. A panel plotting \((1-\delta) r(y, \eta) + \delta \underline v\) against \(\eta\) for a fixed \(y\), with its maximum at \(\eta = B(y)\), would show the reader why one deviation suffices instead of asking them to take it.

Low severity#

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

Strengths#

  • Bold-for-definitions and italic-for-emphasis are held exactly over 1136 lines, in both directions. Every term is bolded where it is coined - subgame perfect equilibria (45), dynamic programming squared (79), rational-expectations payoff (186), deviation payoff (189), promised value (311), admissible (403), self-generating (417), self-enforcing and self-rewarding (729-730) - and every emphasis is italic - reputation (40), continuum (52), worse (92), be (298), want (315), with equality (603), restart (677), everyone (949). Not one crossover, which is rare in this corpus.

  • The lecture states its own conclusion before building anything, quotes the source’s one-sentence version of it (57, “the multiplicity of credible plans replaces pessimism with agnosticism”), and then says at 59-64 what the conclusion costs the argument of the sibling lecture {doc}`phillips_two_stories` - so a reader knows what the machinery is for before meeting it.

  • Every closed form is checked against its own definition in code rather than asserted. 215-217 verifies r_keep and r_cheat against r with np.allclose; 583-584 verifies the two hand-solved endpoints against the independent APS set iteration and prints whether they agree; and 862-886 recomputes all ten numbers of the book’s table with the book’s own values in a third column.

  • The upper bound \(y^\#\) is introduced with an explicit promissory note - 157-158, “the upper bound \(y^\#\) is what makes the government’s problem non-trivial, as we shall see when we look for the worst equilibrium” - and the note is paid off precisely where promised, at 528-531.

  • The multiplicity section (740-855) is the sharpest construction in the lecture: three strategies written as three small functions (767-802), one figure with a promised-value row and an inflation row per method (805-831), a printout of settling time and terminal value for each (834-841), and prose that reads the differences off the numbers - and the terminal values check out (method 2 freezes at \(-37.69\) against \(v^N = -38.76\), “just better than Nash” at 847; method 3 at \(-63.12\) against \(\underline v = -63.22\), “barely above the worst one” at 850).

  • Exercise cpol_ex2’s solution finds something the lecture’s own algebra did not predict and explains it: 1065-1070 observes that Ramsey survives well below the \(\delta^\star \approx 0.28\) of {eq}`cp_cutoff` and attributes it to the threat being the worst equilibrium rather than Nash reversion - the exercise corrects the reader’s likely reading of the main text.

  • Exercise cpol_ex3 (1081-1133) verifies the tightest of the three constructions phase by phase - promise delivered, continuation inside \(V\), incentive constraint in both phases - and then reads the thin slack it finds as economics (1126-1133: “the punishment for deviating is only barely worse than the equilibrium itself”).

  • The historical section earns its place instead of decorating: Necker’s 1784 sentence is quoted (335-336) and then taken apart clause by clause into the modern incentive-compatibility condition (340-343), which is a better motivation for {prf:definition} cp_spe at 345 than a paragraph of exposition would have been.