Repository navigation
Keep lognormal fixture income in levels - #642
Closed
hmgaudecker wants to merge 2 commits into
Closed
hmgaudecker wants to merge 2 commits into
hmgaudecker wants to merge 2 commits into
Conversation
The lognormal process draws income in levels while every other process draws log income, but the shared wealth transition exponentiated the state for all of them. The lognormal variant therefore added exp(exp(z)) to wealth, reaching seven orders of magnitude past its wealth grid, and its value test could only be bounded loosely against an analytic recurrence. The fixture now selects a level transition and constraint for the lognormal process, so it is the normal fixture with the exponential moved into the process: same value function, same panel with income exponentiated. A parity test pins that, and the regression test compares the lognormal values to the normal solution pickle. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LAZ63AjbZFLweWuJyPUs6S
Only the lognormal panel changes in content; the other four are byte-different serializations of identical frames, regenerated together so the provenance record describes every file in the directory. Generated at float64 on CPU with jax 0.12.0.1. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LAZ63AjbZFLweWuJyPUs6S
Documentation build overview
4 files changed± beta-delta/index.html± epstein-zin/index.html± iskhakov-et-al-2017/index.html± tiny-example/index.html |
Member
Author
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.
Summary
The lognormal process draws income in levels while every other process in the test fixture draws log income, but the shared wealth transition exponentiated the state for all of them. The lognormal variant therefore added
exp(exp(z))to wealth, reaching seven orders of magnitude past its wealth grid of 1 to 5. Its value test could only be bounded loosely against an analytic recurrence with a relative tolerance of 1e-4.The fixture now selects a level transition and constraint for the lognormal process. The lognormal variant is then the normal variant with the exponential moved into the process: same value function, same panel with income exponentiated.
tests/test_models/processes.py:get_wealth_functionsandget_initial_incomepick the level variants forlognormal; both the single-regime and the multi-regime fixture use them. ADistributionTypealias replaces the repeatedLiteral, which also lets the cross-regime test drop itstysuppressions.tests/test_lognormal_fixture_parity.py: pins value equality with the normal fixture at rtol 1e-12 and panel equality with income exponentiated.tests/test_processes.py: the analytic recurrence, its 1e-4 bound and the dedicated tail test are gone; the regression test compares lognormal values tosolution_normal.pkl.tests/data/processes/random-v1/: panels regenerated at float64 on CPU. Only the lognormal panel changes in content; the other four are byte-different serializations of identical frames and are regenerated together so the provenance record describes every file in the directory.Verification
tests/test_processes.pyand the parity test in the branch's lockedtests-cpuenvironment,--precision=64, CPU: 768 passed, 0 failed.prek run --all-filespasses.https://claude.ai/code/session_01LAZ63AjbZFLweWuJyPUs6S