Repository navigation
Add gradual_liberalization_network lecture and extend organizational_equilibrium - #399
Conversation
…equilibrium
New lecture gradual_liberalization_network ("Gradual Liberalization in a
Global Production Network"), placed after organizational_equilibrium:
a three-country, five-sector version of the Bassetto-Huo-Rios-Rull (2026)
trade model with intermediate inputs, solved by exact hat algebra from
illustrative shares. It decomposes the effect of tariffs on worker
welfare, derives a first-order condition on cross-sector wage inequality
under which the Markov and best constant tariffs are positive, computes
Markov, Ramsey, and organizational equilibrium tariff paths and their
response to a protectionist shock, and discusses trade blocs (Bonadio
et al. 2026). Three exercises with dropdown solutions.
Additions to organizational_equilibrium: two decompositions of worker
welfare, a table matching the growth and tariff models, a three-step
computing recipe, workers' consumption paths across equilibria, and a
table comparing the equilibria after a temporary shock.
Adds bib entries Armington1969, HuoLevchenkoPandalaiNayar2025, and
BonadioEtAl2026.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Deploy Preview for lustrous-melomakarona-3ee73e ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
🔵 Needs a closer look
Verifying the solver's many hardcoded numeric claims in the 1140-line lecture requires a CI notebook execution that cannot be run here, leaving quorum unmet.
No open issues 🎉
What changed in this PR
This PR adds a new QuantEcon lecture, gradual_liberalization_network ("Gradual Liberalization in a Global Production Network"), and extends the existing organizational_equilibrium lecture with additional welfare decompositions, comparison tables, and worker-consumption analysis. The new lecture builds a small three-country, five-sector version of the Bassetto–Huo–Ríos-Rull (2026) trade model with intermediate inputs, solved by exact hat algebra from illustrative shares, and reuses the dynamic policy machinery of organizational_equilibrium to compute Markov, Ramsey, and organizational-equilibrium tariff paths plus their response to a protectionist shock. It fits into the "tariff/trade-cooperation" cluster of lectures, serving as the multi-country, multi-sector sequel to organizational_equilibrium.
Changes:
- New 1140-line lecture
gradual_liberalization_network.md(model setup, separability, solving-in-changes solver, welfare decompositions, a first-order conditiongln-condition, dynamic tariff paths, trade-blocs discussion, and three exercises with dropdown solutions). - Extends
organizational_equilibrium.md:static()now also returns real wagesω_i, two welfare decompositions, a growth-vs-tariff model mapping table, a three-step organizational-equilibrium recipe, workers' consumption paths across equilibria, and a post-shock comparison table, with cross-links to the new lecture. - Registers the lecture in
_toc.ymland adds three BibTeX entries (Armington1969,HuoLevchenkoPandalaiNayar2025,BonadioEtAl2026).
I reviewed the Python code, the mathematics, and the cross-references in detail. All static() call sites in organizational_equilibrium.md were correctly updated for the new 6-tuple return (e.g., [2:] → [2:4]), the decomposition and consumption-path cells are algebraically consistent, and I numerically confirmed that ψ_i stays positive over the wider [0, 1.5] grid (min ≈ 0.34) so the np.log/argmax are safe and the "peaks at about 85 percent" claim matches the computed value. In the new lecture, the revenue_system/solve_changes einsum dimensions and exponents match the stated equations, calibration arrays (λ, Φ, each Ξ row, α_k+α_l+α_x) sum to one, the first-order condition derivation matches gln-condition, all cross-cell variables are defined before use, and every {eq}/{ref}/{doc}/{cite} reference resolves. I did not find concrete defects to flag.
Note: the lecture quotes many hardcoded numerical results in prose that are generated by the heavy exact-hat-algebra solver; their correctness ultimately depends on a successful CI notebook execution, which I could not run in this environment.
| File | Description |
|---|---|
lectures/gradual_liberalization_network.md |
New lecture: multi-country/multi-sector tariff model, exact-hat-algebra solver, welfare decompositions, dynamic tariff paths, exercises. |
lectures/organizational_equilibrium.md |
Adds real-wage output to static(), two welfare decompositions, model-mapping and post-shock tables, consumption-path analysis, and cross-links to the new lecture. |
lectures/_toc.yml |
Registers gradual_liberalization_network after organizational_equilibrium. |
lectures/_static/quant-econ.bib |
Adds Armington1969, HuoLevchenkoPandalaiNayar2025, BonadioEtAl2026. |
Review effort: Balanced
Style guide: - Shorten six figure captions to six words or fewer (qe-fig-004). - gradual_liberalization_network: bold the defined terms "static separability" and "exact hat algebra", which were in italics (qe-writing-005). gradual_liberalization_network: - Find the 5, 10 and 30 percent grid indices by value instead of hard-coding them, so they stay correct if tau_grid changes. - Rename the Ramsey horizon from N, which the text uses for the number of countries, to horizon. - Use h as the summation index in U_t so it does not clash with capital k_nj. - Describe the sector bar chart accurately: gains fall with baseline consumption for the three lowest-paid groups, but the two best-paid groups are not in order. - Drop an f-string with no placeholders. organizational_equilibrium: - Print how the gain in equality splits between wage changes and the rebate, which the text asserts but the cell did not compute. - Reword the Ramsey import-sector recovery to match the printout: back to the Markov level in period 5, above it from period 6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ReviewThe economics and the code hold up. I've pushed one commit of style fixes and small cleanups (54d54a7). The remaining questions are about claims concerning other papers and are collected in #400. What I checked
Changes in 54d54a7 and 02c1ef6
After these edits, both lectures produce the same output as before, plus the one new print line. Open questions for the authorSee #400. It covers an inference in the new lecture about what drives the G7 tariff in Bassetto, Huo, and Ríos-Rull (2026), two figures and the bib year for Bonadio et al., and three figures from Bassetto, Huo, and Ríos-Rull (2026) that I couldn't check against the paper. None of them affects the code or its results. RecommendationMerge once the CI |
The index is a dummy variable, so k is correct; the switch to h in the previous commit was cosmetic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New lecture gradual_liberalization_network ("Gradual Liberalization in a Global Production Network"), placed after organizational_equilibrium: a three-country, five-sector version of the Bassetto-Huo-Rios-Rull (2026) trade model with intermediate inputs, solved by exact hat algebra from illustrative shares. It decomposes the effect of tariffs on worker welfare, derives a first-order condition on cross-sector wage inequality under which the Markov and best constant tariffs are positive, computes Markov, Ramsey, and organizational equilibrium tariff paths and their response to a protectionist shock, and discusses trade blocs (Bonadio et al. 2026). Three exercises with dropdown solutions.
Additions to organizational_equilibrium: two decompositions of worker welfare, a table matching the growth and tariff models, a three-step computing recipe, workers' consumption paths across equilibria, and a table comparing the equilibria after a temporary shock.
Adds bib entries Armington1969, HuoLevchenkoPandalaiNayar2025, and BonadioEtAl2026.