Fix the Defined Benefits and Points System pensions so they can actually run#1167
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1167 +/- ##
==========================================
- Coverage 72.95% 72.92% -0.04%
==========================================
Files 22 22
Lines 5480 5525 +45
==========================================
+ Hits 3998 4029 +31
- 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:
|
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
|
@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? |
|
Thanks @jdebacker. All set: Version bumped to 0.17.0 (pyproject.toml and ogcore/init.py). Ready to merge whenever you are. |
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