Fix the Defined Benefits and Points System pensions so they can actually run#1167
Open
marcelolafleur wants to merge 6 commits into
Open
Fix the Defined Benefits and Points System pensions so they can actually run#1167marcelolafleur wants to merge 6 commits into
marcelolafleur wants to merge 6 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1167 +/- ##
==========================================
- Coverage 72.95% 72.87% -0.08%
==========================================
Files 22 22
Lines 5480 5516 +36
==========================================
+ Hits 3998 4020 +22
- Misses 1482 1496 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This was referenced Jul 10, 2026
This was referenced Jul 10, 2026
Pre-time-path wages are anchored to the period-0 wage of the current path (trend growth is handled by the de-trending in the benefit formulas); labor comes from the model's initial condition. The bulk (T,S,J) evaluation reconstructs each retiree's benefit from their own cohort's wage history so aggregates match household behavior exactly.
31f7cf2 to
a494b31
Compare
Member
|
@marcelolafleur I appreciate the clarity in this PR about what is addressed and what is not. While not totally solving all of Issue #1014, I think this PR is an important addition and fix of the DB and PS pension systems. I want to merge this and create a new release. Can you update the version to 0.17.0 and include in the change log not just this PR, but the changes in PRs #1174, #1171, and #1166? |
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.
The non-US pension systems in
pensions.pycrash when used with a real Specifications object. We found this calibrating OG-BRA: Brazil's pension system (RGPS) is a defined benefits scheme, so OG-BRA is the first country model to usepension_system = "Defined Benefits"— and it crashes on the first solve. Same family of bugs as the Points System crash reported in #1075.The cause is that these code paths were never updated after some parameters became time-varying: the functions pass arrays where the numba loops expect scalars, and scalars where they expect arrays. The existing tests didn't catch this because they feed the loops pre-cleaned inputs from mock objects instead of a real Specifications object.
Three changes (the third was added after testing a full transition path downstream):
default_parameters.jsonyet — so it remains unusable for now.DB_3dim_loop, built from each cohort's own wage history so aggregates match household behavior; it reproduces the steady-state solution to machine precision on a constant path).Fixes #1075. Part of #1014.
Tested: full pension and tax suites pass (71 tests); the DB steady state solves. Downstream check: the OG-BRA Defined Benefits calibration solves both the baseline and a reform transition path against this branch, passes the resource-constraint check on both, and hits its pension spending target to four decimals.
cc @rickecon @jdebacker