Repository navigation
Conversation
…xercises ak2: - Fix marginal product of capital, the dating of debt in the capital transition law, and the old-age lump sum tax in the young person's problem (text disagreed with the code in each case) - Correct the claim about who bears the cost of government asset accumulation: the initial old are unaffected, while the cohorts young at t=0,1 lose; state G_0 = 0 in Experiment 3, as the code does - Present the closed-form steady state as the zero-debt case - Add Overview heading, notebook header, label, and style fixes; drop globals from the plotting methods ak_aiyagari: - Widen the asset grid from 10 to 40: at 10, 30% of the population was pinned at the upper bound, understating K by ~30% and overstating r by ~190 basis points - Weight age-specific transfers by population share in the government budget constraint, and show the 1/J weights in the text - Add iteration caps to find_ss and path_iteration, which could loop forever - State the borrowing constraint, no depreciation, and the absence of retirement; rewrite both experiment narratives so that the debt path is the policy and the anticipation effect works through the after-tax rate two_computation: - Replace the certainty-equivalence claim, which contradicted the risk-sensitive preferences, and explain what sigma < 0 does - Replace asserted welfare rankings with computed newborn welfare, and add a summary table of the four scenarios - Document the calibration consistency between the two price regimes and the funded debt target - Add market clearing to the equilibrium definition, the per-capita resource constraint, GDP, the labor-tax term in the compensation formula, a notation table, and concluding remarks - Remove dead and broken code; normalize figure labels Each lecture gains three exercises with dropdown solutions. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The changes are extensive content/math revisions with substantial new executable exercise code whose numeric claims and successful notebook execution cannot be fully verified without running the full build, so final human review is warranted.
1 open finding
What changed in this PR
This PR revises three QuantEcon lecture files (ak2.md, ak_aiyagari.md, two_computation.md) to correct mathematical and economic inaccuracies, reconcile the prose with the executed code, and add three worked exercises (with dropdown solutions) to each lecture. These are MyST-markdown lectures whose code cells are executed during the Jupyter Book build, so correctness of the new code matters for CI.
I verified the key corrections against the surrounding code and confirmed they are consistent:
ak2.md: the firm FOCr_t = α K^{α-1} L^{1-α}matchesK_to_r; the debt term in the capital law is correctly datedD_{t+1};δ_{o,t+1}dating and the Lagrangian sign flip are consistent; the new exercises callclosed.simulate/ak2.simulatewith valid signatures and existing globals (τ_hat,Cy_hat,K_to_r, etc.).ak_aiyagari.md: the1/Jweighting in the prose now matchesfind_τandcompute_aggregates; thea_max10→40 change and the iteration caps are consistent; the extraireturn value fromfind_ssis appended last, so all existing slices/indexing (ss1[:3],ss1[9],ss1[-1]) remain valid.two_computation.md: operator renames (𝒯_t,𝒟_t,𝒮_t) are consistent and disambiguated fromT_t(s)taxes; the σ=0 certainty-equivalence discussion is handled insolve_riccati_step; removed dead code (buyout_compensation_exp1_exo,age_mask/ε_masked) has no remaining references; the new GDP/resource-constraint equations match_compute_gdp.
Changes:
- Corrected math/economics (marginal products, debt dating, lump-sum tax dating, cohort incidence) to agree with the code across all three lectures.
- Widened the Aiyagari asset grid and added
1/Jpopulation weighting and iteration caps to avoid non-convergence. - Added notation/summary tables, computed welfare rankings, concluding remarks, and three exercises per lecture.
| File | Description |
|---|---|
| lectures/ak2.md | Fixes firm FOC, debt/δ dating, steady-state closed form; adds overview/header and three steady-state/transition exercises |
| lectures/ak_aiyagari.md | Adds 1/J weighting, widens asset grid to 40, adds iteration caps and new return value, rewrites experiment narratives, adds three exercises |
| lectures/two_computation.md | Replaces certainty-equivalence claim, adds notation/GDP/market-clearing content and computed welfare, removes dead code, normalizes labels, adds three exercises |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
📖 Netlify Preview Ready!Preview URL: https://pr-1078--sunny-cactus-210e3e.netlify.app Commit: 📚 Changed LecturesBuild Info
|
mmcky
left a comment
There was a problem hiding this comment.
Thanks @thomassargent30, this is a big improvement to all three lectures. I checked every number quoted in the new exercises and concluding remarks against the executed outputs in the preview build and they all agree, and the corrected formulas (marginal product of capital, the dating of debt and of the old-age lump sum tax, the 1/J weights, the compensation formula) now match what the code computes. The build is green.
I found a few small things in the text that I'd suggest fixing before we merge. I'm happy to push these to the branch myself if you'd like; just say the word.
1. Explanation of the newborn welfare ranking in two_computation. The welfare table is computed from the fixed-price terminal steady states (exp1_exo and exp2_exo), where the wage is held at
2. Compensation formula in Step 4 of Experiment 1 (two_computation). The new formula writes the labor-tax term as _compute_compensation uses the dated tax path, so a cohort that is still alive after
3. Copilot's comment is right. The sentence "Passing compensation_data to find_transition_exo turns the buy-out on, since it sets comp_mult to one inside apply_compensation" misattributes where comp_mult is set. It is set to one inside find_transition_exo when compensation_data is passed, and apply_compensation only receives it as an argument.
4. Cross-references to the social security experiment. Exercise 3 in ak2 says it complements "the transition computed in {ref}exp-tax-cut", which is Experiment 1 (the tax cut). It complements Experiment 4, the unfunded social security system, which currently has no label. Exercise 3 in ak_aiyagari has the same problem: its link text says "Experiment 4 of the two-period model" but the target is the top of the ak2 lecture. Adding a label such as (exp-social-security)= above Experiment 4 in ak2 and pointing both references there would fix both.
One note for the record rather than a change request: widening the asset grid to ak_aiyagari (steady-state capital goes from about
two_computation: - Explain the newborn welfare ranking in terms of the labor tax rate and retained benefits, since the compared steady states hold the wage fixed - Date the labor-tax term in the compensation formula as τ_ℓ(s+j) to match _compute_compensation - Attribute the setting of comp_mult to find_transition_exo ak2, ak_aiyagari: - Add an exp-social-security label to Experiment 4 and point the exercise cross-references there instead of at the tax cut or the top of the lecture Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Lowercase the headings of Experiments 2 and 3 in ak2 to match Experiments 1 and 4 - Lowercase axis labels in two_computation (figure rule 6) - Replace embedded titles on single-panel figures with mystnb captions in ak2 and ak_aiyagari, and drop the duplicate title on the already captioned population figure in two_computation (figure rule 1) - Make the capital-stock zoom plot in ak_aiyagari data-driven: its y-limits and annotation were hardcoded around the old steady-state capital of 6.6, so after the asset-grid change the figure was empty - Collapse runs of spaces in narrative text (writing rule 008) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Pushed a style-guide pass in b90a47b: lowercase headings and axis labels, mystnb captions in place of embedded titles on single-panel figures, and collapsed double spaces in narrative text. One change goes beyond style: the capital-stock zoom plot in |
✅ Translation sync completed (zh-cn)Target repo: QuantEcon/lecture-python.zh-cn
|
…ources (#1083) The publish-2026oct09 run deployed the 5 October build cache unchanged: its HTML step logged "no targets are out of date" and wrote nothing, and the release tarball's ak2.html lacks the content merged in #1078. Sphinx's HTML builder rewrites a page only when its source is newer than the existing output file, and the cache artifact is extracted after the checkout, so every cached page looks newer than its source. Remove _build/html and _build/.doctrees after the cache download, as ci.yml already does for .doctrees. Notebook execution stays cached in _build/.jupyter_cache, so this costs only the HTML render. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>

ak2:
ak_aiyagari:
two_computation:
Each lecture gains three exercises with dropdown solutions.
thanks @thomassargent30