QuantEcon / QuantEcon/lecture-python.myst
[lq_robust_bewley] Follow-ups from the #1040 review: solver iteration margin, uniqueness wording, falsification wording
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 123
- Forks
- 57
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 11
Description
Follow-up to #1040, which replaced the circular observational-equivalence check in lectures/lq_robust_bewley.md with a genuine one (each type's robust LQ problem solved separately, rules compared to the benchmark). The verification itself is sound; reviewing it turned up three small things worth tidying in a later pass. A separate whole-lecture style pass is planned and is deliberately out of scope here.
Line numbers refer to the file as merged from #1040.
1. Thin max_iter margin in solve_rslq near the breakdown point
The risk-sensitive Riccati iteration contracts at rate $\beta\zeta(\sigma)$, which goes to 1 at the breakdown point $\underline\sigma$ (this is the same fact the lecture uses to explain the breakdown point: $\beta\zeta(\underline\sigma) = 1$). The cross-section population grid starts at 0.99 * σ_lo, where $\beta\zeta = 0.99947$, and at that point the solver needs about 42,600 iterations against a max_iter of 50,000 (it fails at 40,000 and passes at 45,000). At 0.999 * σ_lo it needs more than 200,000.
This is deterministic, so CI will not flake, but anyone nudging the grid closer to $\underline\sigma$ gets a RuntimeError from the solver. Options:
- raise
max_iterto something like500_000(the whole lecture executes in about 5 seconds, so the cost is negligible), or - start the population grid at
0.95 * σ_lo, or - both, plus a one-line comment in
solve_rslqor at the grid definition explaining that convergence slows as $\beta\zeta \to 1$, which turns a hidden constraint into a small piece of pedagogy the lecture already has the language for.
Relevant lines: the solve_rslq definition (about line 328) and σ_pop = np.linspace(0.99 * σ_lo, 0.0, 12) (about line 485).
2. Uniqueness wording left behind after part 2 of the proposition was weakened
#1040 correctly restated part 2 of prop-rbew-types as existence rather than uniqueness ("$R = \beta^{-1}$ is an equilibrium gross interest rate"), and the proof now says so explicitly ("what we have shown is that this rate reproduces itself as an equilibrium for any $\Phi$, not that no other rate could"). Three other places still read as uniqueness:
| Location | Current text |
|---|---|
| Overview bullet (about line 47) | "how the equilibrium interest rate $R = \beta^{-1}$ and all aggregate and cross-section dynamics therefore coincide" |
| Concluding remarks (about line 522) | "The equilibrium interest rate $R = \beta^{-1}$, the aggregate dynamics, and the linear growth ... are all inherited unchanged" |
Solution to rbew_ex2 part 2 (about line 653) |
"The type distribution never enters, so it cannot affect the equilibrium rate." |
These should be brought into line with the proposition so that the hedge in part 2 reads as deliberate. Something like "the benchmark interest rate $R = \beta^{-1}$ still clears the market, whatever the distribution of types" works in all three spots.
3. "first decimal place" understates the falsification result
After the off-locus test (about line 402) the text says "A one percent departure from the locus moves the rule in the first decimal place". The table it describes shows deviations of 0.26, 0.45 and 1.7 (and 0.27, 0.47, 1.0 on the other side), so the most robust type moves in the ones place, not the first decimal. "by an amount of order 0.1 to 1" matches the table as printed.
Verification notes
All three points were checked by executing the merged code locally: the iteration counts in item 1 come from calling the lecture's own solve_rslq with max_iter set to 40,000 / 45,000 / 50,000 at 0.99 * σ_lo, and the deviations in item 3 are the values the lecture prints.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Work in lectures/lq_robust_bewley.md, starting with solve_rslq near line 328 and the σ_pop definition near line 485. Review the three wording locations around lines 47, 402, 522, and 653, then execute the lecture to confirm the solver converges and the revised statements match the printed table and proposition. Done means the iteration margin is addressed and all three explanations are consistent with the verification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100