Promote the Iskhakov et al. (2017) model to an example with docs#374
Open
hmgaudecker wants to merge 17 commits into
Open
Promote the Iskhakov et al. (2017) model to an example with docs#374hmgaudecker wants to merge 17 commits into
hmgaudecker wants to merge 17 commits into
Conversation
The deterministic retirement model that the analytical-solution tests replicate moves from tests/test_models/deterministic/base.py to src/lcm_examples/iskhakov_et_al_2017.py; base.py becomes a re-export shim so the test suite keeps its import location. Docs: an example page (docs/examples/iskhakov_et_al_2017.md, with the QE citation in references.bib) and an explanation notebook (docs/explanations/iskhakov_et_al_2017.ipynb) that plots the saw-tooth consumption function — each tooth is one optimal retirement age: as people retire later, their lifetime wealth increases, changing the optimal consumption path — plus a horizon comparison showing the teeth accumulate with remaining work-life. A closing section is reserved for the brute-force vs DC-EGM comparison once the solver lands. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
The forward simulation evaluates every regime's policy for all subjects and masks out-of-regime entries afterwards; those placeholder entries can be -inf when a subject's state is infeasible under the other regime's problem. The NaN/Inf warning fired on these placeholders — a false positive that surfaced on every multi-regime simulation at log_level="warning". Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ase. The horizon comparison now starts at one decision period, which has no kink at all: income earned by working arrives in the following period's budget, so with no period left to enjoy it, working is pure disutility and everyone retires — the first kink appears with two decision periods, where the work-vs-retire values cross. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
At the packaged default resolution the sharp drop at a retirement threshold shows up as a two-step drop with a spurious intermediate plateau: linear interpolation smears the next-period value function's kink across a wealth-grid cell and the consumption grid quantizes the policy. The main figures now use finer grids (where the drop is a single jump, matching the analytical solution), and a zoomed default-vs-fine comparison documents the artifact — and motivates DC-EGM, which places kinks exactly without a consumption grid. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
At each threshold (initial wealth of about 32.4, 50.4, 68.3, 86.4) the agent retires one period earlier — the marginal value of leisure exceeds the marginal utility of the consumption the extra wage would buy — so lifetime wealth is one period's income smaller and consumption drops; beyond 86.5 the agent never works. Thresholds and the periods-worked progression (4 -> 3 -> 2 -> 1 -> 0) verified on the fine-grid solution. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Benchmark comparison (main → HEAD)Comparing
|
This was referenced Jun 10, 2026
…' into example/iskhakov-et-al-2017
The explanation notebook constructs the same fine-grid model up to four times across its sections; each fresh model object recompiles every kernel. Caching the builder makes repeat uses execution-only, keeping the docs build inside the Read the Docs time limit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…' into example/iskhakov-et-al-2017
Base automatically changed from
feat/canonical-broadcast-grammar
to
feat/phase-variant-states
June 11, 2026 18:48
The forward simulation evaluates every regime's policy for all subjects; the per-regime `validate_V` check now sees only the subjects simulated in the regime, matching the NaN/Inf warning's masking, so placeholder values of out-of-regime subjects can never raise. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…SourceEconomics/pylcm into example/iskhakov-et-al-2017
This was referenced Jun 11, 2026
mj023
approved these changes
Jun 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Promotes the deterministic retirement model behind the analytical-solution tests to a proper example (
lcm_examples.iskhakov_et_al_2017), with an example page and an explanation notebook plotting the paper's signature saw-tooth consumption function — each tooth is one optimal retirement age: as people retire later, their lifetime wealth increases, changing the optimal consumption path. The notebook's closing section is reserved for the brute-force vs DC-EGM comparison once the solver lands; this PR is the first piece of that stack and is independent of #373.tests/test_models/deterministic/base.pybecomes a re-export shim, so the test suite keeps its import location.🤖 Generated with Claude Code