jv#

  • Series: lecture-dp

  • File: lectures/jv.md

  • Audit date: 2026-08-26

  • Corpus snapshot: c30490a2f4

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

  • Overall score: 8.0 / 10

  • Priority: HIGH

Score breakdown#

Category

Score

One-line note

Writing

3.5/10

qe-writing-006 ×3; qe-writing-005 ×2; qe-writing-003 ×2, +3 more.

Math

9.5/10

qe-math-009 ×2.

Code

7.5/10

qe-code-001 ×6.

JAX

out of scope

JAX rules target lecture-jax.

Figures

6.5/10

qe-fig-005 ×3; qe-fig-003 ×1; qe-fig-008 ×3, +1 more.

References

9/10

qe-ref-001 ×1.

Links

10/10

no mechanical violations detected.

Admonitions

10/10

no mechanical violations detected.

Issues#

Critical#

None found.

High severity#

  • [qe-code-001] (reviewer) — Follow PEP8 unless closer to mathematical notation. Count: 6. Lines: 205, 247, 287, 308, 329, 378. Example: line 205 is the substantive one: ɛ = 1e-4 inside __init__ rebinds the constructor’s own ɛ parameter (195), so grid_max (206) and x_grid (209) silently ignore whatever the caller passed while self.ɛ (198) keeps it - JVWorker(ɛ=1e-2) therefore changes the tolerance the operator uses but not the grid it was supposed to change. Beyond that: lines 287 and 308 are 89 characters (E501); a blank line separates def from its docstring in operator_factory (246-247) and solve_model (328-329); and titles = ["s policy", policy",  "value function"] has two spaces after the second comma (378, E241).

  • [qe-writing-006] — Capitalize lecture titles properly. Count: 3. Lines: 45, 130, 359. Example: H3 Title Case: ‘Model Features’ (Features).

Medium severity#

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

  • [qe-fig-003] — No matplotlib embedded titles. Count: 1. Lines: 384. Example: .set(title=.

  • [qe-fig-005] — Descriptive figure names for cross-referencing. Count: 3. Lines: 376, 444, 526. Example: code-cell figure without mystnb figure metadata.

  • [qe-fig-008] — Use lw=2 for line charts. Count: 3. Lines: 383, 468, 536. Example: plot() without lw=.

  • [qe-math-009] (reviewer) — Choose simplicity in mathematical notation. Count: 2. Lines: 99, 227. Example: \vee is defined at 104 as a \vee b := \max\{a, b\} purely so it can be used twice, in {eq}`jvbell` (99) and {eq}`defw` (227). The identical quantity is written out as \max \{ g(x_t, \phi_t), u_{t+1}\} in {eq}`jd` (84) and as max(g(x, ϕ), u) in the code (266, 456), so the join symbol saves nothing, costs the reader a definition to carry, and leaves the lecture using two notations for one operation.

  • [qe-writing-001] — Use one sentence per paragraph. Count: 1. Lines: 168. Example: 2 sentences in one paragraph.

  • [qe-writing-002] (reviewer) — Keep writing clear, concise, and valuable. Count: 4. Lines: 87, 143, 166, 395. Example: the substitutes prediction is stated three times in almost the same words - ‘Our risk-neutral worker should focus on whatever instrument has the highest expected return’ (143), ‘worker will focus on whichever instrument has the higher expected return’ (166), ‘Worker switches from one investment strategy to the other depending on relative return’ (395) - and the third is presented as a finding from the computation when it is a restatement of the second. The lecture also drops articles into note form at several points, so sentences read as slides rather than prose: ‘Agent’s objective: maximize expected discounted sum of wages via controls’ (87), ‘marginal cost of investment via either \(\phi\) or \(s\) is identical’ (141), ‘Return from investment via \(\phi\) dominates expected return from search’ (161), ‘worker does better by investing’ (397).

  • [qe-writing-003] (reviewer) — Maintain logical flow. Count: 2. Lines: 236, 366. Example: lines 236-239 tell the reader that \(w\) ‘is maximized over all feasible \((s, \phi)\) pairs’, but the code does no maximization - it evaluates a fixed 15x15 grid and keeps the best point (283-290, and again 304-312). That is the reason the \(s\) and \(\phi\) policies in the figure at 376 come out as visible steps rather than smooth curves, and the prose leaves the reader with no way to connect the two. The same three sentences also introduce \(w(z)\) with \(z = (s, \phi)\) (237), notation that appears nowhere else in the lecture. Separately, the (jv_policies)= anchor at 366 sits on the solve cell (368-372), which draws nothing, so ‘Referring back to the figure {ref}`here <jv_policies>`’ at 486 sends the reader to a cell with no figure - the plotting cell is 376-389.

  • [qe-writing-005] (reviewer) — Use bold for definitions, italic for emphasis. Count: 2. Lines: 58, 63. Example: no term anywhere in the file is bolded, including the two objects the whole model is built from: ‘Let \(x_t\) denote the time-\(t\) job-specific human capital of a worker’ (58) and ‘\(s_t\) is search effort, devoted to obtaining new offers from other firms’ (63). ‘job-specific human capital’ then recurs at 50, 69 and 168 as if already established, and ‘search effort’ at 67. Italic is used correctly and sparingly - once, at 501 (infinitely patient) - so the emphasis half of the rule is clean and only the definition half is missing.

  • [qe-writing-008] — Remove excessive whitespace between words. Count: 3. Lines: 58, 69, 168. Example: 2 spaces.

Low severity#

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

Strengths#

  • The back-of-the-envelope section (129-170) is the best thing in the lecture: two arithmetic comparisons at \(x = 0.05\) and \(x = 0.4\) (147-159) yield two numbered predictions (165-168), and line 393 returns to them and checks them against the computed policies - the loop is actually closed rather than left for the reader.

  • Probability and density notation is right on all three counts: \mathbb{P}\{b_{t+1} = 1\} uses braces for an event (408, qe-math-014 (proposed)), \mathbb{E} u carries its braces (150-151, qe-math-010 (proposed)), and lowercase \(f\) is the offer density everywhere it appears (69, 99, 118, 227, qe-math-015 (proposed)).

  • Every symbol in the code is the Unicode Greek letter from the math - α, β, π, ϕ in the constructor signature (188-195) and in the operator body (260-270) - so x * (1 - ϕ - s) + β * q at 270 can be read straight off {eq}`defw`.

  • Exercise 1 hands the reader a {code-block} scaffold with the axes already configured (421-428) instead of a bare instruction, and its solution’s 45-degree scatter (461-476) answers exactly the two claims (430-433) the reader was asked to argue.

  • Both solutions are gated and collapsed - solution-start with :class: dropdown at 438-440 and 520-522, each closed by solution-end - so no code cell is stranded inside a non-gated directive.