growth_in_dles#

  • Series: lecture-python-advanced.myst

  • File: lectures/growth_in_dles.md

  • Audit date: 2026-08-26

  • Corpus snapshot: b83d6da399

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

  • Overall score: 7.3 / 10

  • Priority: HIGH

Score breakdown#

Category

Score

One-line note

Writing

3/10

qe-writing-004 ×6; qe-writing-001 ×4; qe-writing-005 ×3, +4 more.

Math

7.5/10

qe-math-003 ×8.

Code

7.5/10

qe-code-001 ×6.

JAX

out of scope

JAX rules target lecture-jax.

Figures

7/10

qe-fig-005 ×5; qe-fig-008 ×10.

References

9/10

qe-ref-001 ×1.

Links

10/10

no mechanical violations detected.

Admonitions

N/A

no admonitions, exercises or solutions.

Issues#

Critical#

None found.

High severity#

  • [qe-code-001] (reviewer) — Follow PEP8 unless closer to mathematical notation. Count: 6. Lines: 317, 419, 420, 422, 423, 504. Example: the rule explicitly permits capitals for matrices, and the code declines them exactly where the correspondence with the mathematics would be most useful: 317-325 names the matrices \(A_{22}, C_2, U_b, U_d\) as a22, c2, ub, ud, while the scalars in the neighbouring cell keep their unicode symbols (γ_1, ϕ_1, δ_k, θ_k). The Example 2 renamings then produce names that read as other symbols: γ2 = 0.15 is the scalar \(\gamma_1\) of Example 2 and γ22 (420) is the \(\Gamma\) matrix built from it, so γ22 looks like \(\gamma_{22}\) and sits three lines from the genuine a22; ϕ_12 = 1 (422) is the scalar \(\phi_1\), not \(\phi_{12}\), and ϕ_i2 (423) is the matrix \(\Phi_i\). Likewise \(\lambda\) is carried in l_λ (312), l_λ2 (504) and l_λ3 (547) - a prefix that means nothing here, since λ is free and the neighbouring π_h, δ_h, θ_h take no prefix.

  • [qe-fig-005] — Descriptive figure names for cross-referencing. Count: 5. Lines: 351, 433, 514, 546, 573. Example: code-cell figure without mystnb figure metadata.

  • [qe-fig-008] — Use lw=2 for line charts. Count: 10. Lines: 353, 354, 438, 439, 518, 519, 554, 555, 581, 582. Example: plot() without lw=.

  • [qe-math-003] — Use square brackets for matrix notation. Count: 8. Lines: 172, 231, 241, 246, 255, 263, 293, 410. Example: array used as matrix.

  • [qe-writing-004] — Avoid unnecessary capitalization in narrative text. Count: 6. Lines: 284, 395, 455, 500, 524, 535. Example: mid-sentence ‘Example’.

Medium severity#

  • [qe-writing-001] — Use one sentence per paragraph. Count: 4. Lines: 196, 275, 348, 534. Example: 2 sentences in one paragraph.

  • [qe-writing-002] (reviewer) — Keep writing clear, concise, and valuable. Count: 2. Lines: 284, 359. Example: 282-284 runs two sentences together with no punctuation between them: “(In this economy \(\delta_h\) and \(\theta_h\) are arbitrary as household capital does not enter the equation for consumption services We set them to values that will become useful in Example 3)”. 359-361 hedges twice in one 30-word sentence - “Inspection of the plot shows that the sample paths of consumption and investment drift in ways that suggest that each has or nearly has a random walk or unit root component” - where the next two cells settle the question exactly (366 prints the eigenvalues, 372 states the answer).

  • [qe-writing-003] (reviewer) — Maintain logical flow. Count: 2. Lines: 575, 587. Example: Example 3.2 is not the experiment the text describes. 571 says “Next let’s lower \(\beta\) to 0.94” - one change against Example 3 - and 587-595 then attributes the loss of growth entirely to \(\beta(\gamma_1 + \delta_k) < 1\). But 575 builds pref4 = (β_2, l_λ, π_h, δ_h, θ_h) with l_λ, the Example 1 value \(\lambda = 0\) set at 312, rather than the l_λ2 = -1 of Example 3 (504-505). So the cell lowers \(\beta\) and removes the habit persistence that 481-485 introduced as the very thing that generates growth, which makes the conclusion at 587-595 unsupported by the run - and inconsistent with Example 3.1, which correctly changes only \(\lambda\) (547-548) while holding everything else at the Example 3 values. Either 575 should read l_λ2 or the prose has to say that two parameters moved.

  • [qe-writing-005] (reviewer) — Use bold for definitions, italic for emphasis. Count: 3. Lines: 361, 468, 495. Example: the two terms the lecture introduces are set in quotation marks rather than bold: Jones and Manuelli’s “growth condition” (468, and used again at 471 and 534) and the effective “bliss point” (495), both of which are being defined at those points. The only bold in the file is at 361, on two terms that are not being defined there - “suggest that each has or nearly has a random walk or unit root component” is emphasis, which the rule assigns to italic, and the lecture uses italic correctly for exactly that job at 466 (“sustained growth”).

  • [qe-writing-007] (reviewer) — Use visual elements to enhance understanding. Count: 3. Lines: 351, 352, 542. Example: the lecture is a comparison of five economies, and all five figures are the same two lines drawn the same way - plt.plot(econ.c[0], label='Cons.') and plt.plot(econ.i[0], label='Inv.') at 353-354, 438-439, 518-519, 554-555 and 581-582 - with no title, no caption, no axis labels and no shared scale, so on the built page they are five indistinguishable pictures whose differences the reader has to reconstruct from the surrounding prose. The two experiments in Examples 3.1 and 3.2 (542-599) exist purely to be contrasted with Example 3, and putting those three paths on one set of axes, or the five economies in a shared-axis panel, is the figure this lecture is actually about. Second, the pointers that would help a reader locate the source figures are buried in code comments where the published page does not show them: “# This is the right panel of Fig 5.7.1 from p.105 of HS2013” (352) and “# This is the right panel of Fig 5.10.1 from p.110 of HS2013” (517) belong in the prose or in the figure captions. Third, the five eigenvalue cells (366, 376, 460, 531, 566) print bare tuples whose numbers carry the whole argument of the lecture - unit root, below unity, two unit roots, one below unity, one above - and none of them is labelled or tabulated.

Low severity#

  • [qe-ref-001] — Use correct citation style. Count: 1. Lines: 27. Example: {cite} in narrative flow: ‘{cite}’.

  • [qe-writing-008] — Remove excessive whitespace between words. Count: 1. Lines: 29. Example: 2 spaces.

Strengths#

  • The three economies are built as one parameterisation with a stated list of what varies: 54-115 fixes the common structure and 108-115 says an instance is exactly the fourteen matrices and \(\beta\), then 196-267 fixes the shared preferences, technology and information, and 269-271 names the seven parameters plus \(x_0\) that will move across the examples - so each later section only has to give a delta.

  • Every claim about growth is checked against the eigenvalues of \(A^o\) rather than eyeballed from the plot: 363-377 finds the near-unit endogenous eigenvalue behind Hall’s random walk and attributes the gap to the small adjustment cost \(\phi_1\) (372-373), 455-461 confirms the faster convergence in Example 2, 534-537 finds the two unit eigenvalues in Example 3 and says which parameter each comes from, and 562-563 and 594-595 do the same for the two failures.

  • Example 2’s two changes are each given their predicted effect before the code runs (397-403): raising \(\phi_1\) from 0.00001 to 1 “will lower the endogenous eigenvalue that is close to 1”, raising \(\gamma_1\) from 0.1 to 0.15 “has the effect of raising the optimal steady-state value of capital” - and 444-452 then reads both effects off the simulation and the computed steady state.

  • The growth condition is tied back to the earlier example instead of being introduced as new: 471-474 notes that satisfying it is “actually equivalent to setting \(\beta(\gamma_1 + \delta_k) = 1\), the condition that was necessary for consumption to be a random walk in Hall’s model”, which is the condition already flagged at 286-287, and 476-479 then says plainly that it is necessary but not sufficient.

  • The habit-persistence specification is written out in the form that shows what it does (489-497): the objective with \((c_t - b_t - (1-\delta_h)\sum_j \delta_h^j c_{t-j-1})^2\), followed by the reading that the effective bliss point “now shifts in response to a moving average of past consumption”, and 499-501 points out that only \(\lambda\) has to change because \(\delta_h\) and \(\theta_h\) were already set for this purpose back in Example 1.

  • Steady states are computed only where they are meaningful and the lecture says so: 379-381 justifies computing one for Example 1 because the largest eigenvalue is strictly below unity, and 389-390 immediately warns that “the near-unity endogenous eigenvalue means that these steady state values are of little relevance”.