Skip to content

Add pension contribution wedge to aggregate budget tracking - #45

Merged
jdebacker merged 3 commits into
jdebacker:FDC_SSfrom
rickecon:jdebacker-FDC_SS
Nov 19, 2026
Merged

jdebacker merged 3 commits into
jdebacker:FDC_SSfrom
rickecon:jdebacker-FDC_SS

Conversation

@rickecon

@rickecon rickecon commented Nov 19, 2026 •

Copy link
Copy Markdown
  • make format, make documentation, and make test have been run.

This PR is an update to your branch supporting PR #1284 in the master branch of OG-Core. This PR adds the following:

  • Accounts for the spread between the portfolio return r_p and the FDC return r_fdc = r_p - r_fdc_wedge, which the steady state previously dropped, so that a nonzero r_fdc_wedge broke the resource constraint. The fund invests the balances it owes households (aggregates.get_F, credited r_fdc, including the balances bequeathed by members who die before retirement, which pensions.fdc_bequeathable now credits at r_fdc instead of r_p) and keeps the spread (aggregates.get_fdc_spread) as a pension reserve that earns r_p and adds to domestic savings (aggregates.get_pension_reserves). The new parameter pension_reserve_max_GDPratio (default 0.5, range 0.2 to 0.8) caps the reserve as a share of GDP; reserves above the cap are paid to the government as pension reserve revenue, a new optional argument of fiscal.get_G_ss and fiscal.get_TR that is not tax revenue. The reserve also has a floor of zero: at the end of any period in which it would fall below zero (as with a negative wedge), the government transfers enough to the reserve that it begins the next period at zero or above, a pension reserve transfer that is netted against the revenue in the budget constraint. pensions.fdc_bequeathable now takes r_p, and pensions.fdc_wedge_ss returns the steady-state wedge by age. The steady-state output adds fdc_spread, pension_reserves, pension_reserve_revenue, and pension_reserve_transfer. Adds tests of the reserve rule and steady-state solutions with a nonzero wedge, with the reserve below its ceiling, at its ceiling, and at its floor.

cc: @jdebacker

@rickecon

Copy link
Copy Markdown
Author

@jdebacker. I ran the full pytest suite locally on my machine:

(ogcore) (base) richardevans@Richards-MBP-3 OG-Core % pytest
================================================= test session starts ==================================================
platform darwin -- Python 3.15.2, pytest-9.2.0, pluggy-1.7.0
rootdir: /Users/richardevans/Docs/Economics/OSE/OG/OG-Core
configfile: pyproject.toml
testpaths: tests
plugins: cov-7.1.0, xdist-3.8.0, platformdirs-4.14.7, anyio-4.16.0
collected 930 items                                                                                                    

tests/test_SS.py ..................................................                                              [  5%]
tests/test_TPI.py .............................................................                                  [ 11%]
tests/test_aggregates.py ......................................................                                  [ 17%]
tests/test_basic.py ....                                                                                         [ 18%]
tests/test_constants.py .                                                                                        [ 18%]
tests/test_demographics.py ..........................................................                            [ 24%]
tests/test_elliptical_u_est.py .......                                                                           [ 25%]
tests/test_execute.py .                                                                                          [ 25%]
tests/test_firm.py .....................................................................                         [ 32%]
tests/test_fiscal.py .................................                                                           [ 36%]
tests/test_household.py ...........................................................                              [ 42%]
tests/test_optional_pygam.py ...s                                                                                [ 43%]
tests/test_output_plots.py ..................................................                                    [ 48%]
tests/test_output_tables.py ......................                                                               [ 50%]
tests/test_parameter_plots.py .................................................................................. [ 59%]
.........................                                                                                        [ 62%]
tests/test_parameter_tables.py .......                                                                           [ 63%]
tests/test_parameters.py ..................................................                                      [ 68%]
tests/test_pensions.py ......................................................................................... [ 78%]
..............................                                                                                   [ 81%]
tests/test_run_example.py ..                                                                                     [ 81%]
tests/test_run_ogcore.py .                                                                                       [ 81%]
tests/test_tax.py .....................................                                                          [ 85%]
tests/test_txfunc.py ..................................s.                                                        [ 89%]
tests/test_user_inputs.py .........                                                                              [ 90%]
tests/test_utils.py .........................................................................................    [100%]
============================== 928 passed, 2 skipped, 186 warnings in 5616.40s (1:33:36) ===============================

I also ran the run_ogcore_example.py run script with the following results.

BASELINE STEADY STATE EQUILIBRIUM

GE loop errors = ['4.410e-14', '5.454e-14', '-4.821e-12', '0.000e+00', '-2.212e-12', '-2.131e-13', '1.012e-12', '-2.571e-13', '3.546e-13', '-7.242e-13', '2.706e-13', '-5.379e-14', '-1.991e-13', '1.370e-13']
Iteration: 1  Distance: 3.290589696913687e-11
SS debt = 0.6252962398086119, 0.00794992146864497
IO: (1, 1), C: (1,)
Foreign debt holdings = 0.25011849592344476
Foreign capital holdings = 0.05620836280990171
resource constraint: [-1.08426289e-11]
Checking constraints on capital, labor, and consumption.
There were no violations of the constraints on labor supply.
There were no violations of the constraints on consumption.
Maximum error in labor FOC = 1.0480505352461478e-13
Maximum error in savings FOC = 5.684341886080802e-14
JUST SAVED SS output to  /Users/richardevans/Docs/Economics/OSE/OG/OG-Core/examples/OG-Core-Example/OUTPUT_BASELINE/SS/SS_vars.pkl

BASELINE TRANSITION PATH EQUILIBRIUM (1 min 57.7 sec)

Maximum debt ratio:  1.6224396825504401
w diff: 1.0336998437221467e-06, -7.919676026091338e-09
r diff: 1.2230410295632765e-09, -1.5419383258413744e-07
r_p diff: 1.218882474118832e-09, -1.6367689642526884e-07
p_m diff: 0.0, 0.0
BQ diff: 1.1489913183046485e-07, -1.733433335629822e-08
TR diff: 5.368123179999573e-08, -3.109047113994401e-07
Iteration: 21
Distance: 6.428816710220018e-06
Max absolute value resource constraint error: 8.44274714244253e-07
Checking time path for violations of constraints.
Max Euler error, savings: 3.684552662974738e-12
Max Euler error labor supply: 1.312727704316785e-12
Time path iteration complete.
It took 117.6869421005249 seconds to get that part done.
run time =  117.68698501586914

REFORM STEADY STATE EQUILIBRIUM

GE loop errors = ['3.533e-14', '3.137e-14', '2.851e-12', '0.000e+00', '6.432e-13', '1.290e-13', '1.670e-13', '1.633e-13', '9.559e-14', '1.094e-13', '1.499e-13', '3.425e-14', '5.788e-14']
Iteration: 1  Distance: 6.1961950794529654e-12
SS debt = 0.622881699093486, 0.007919223364536793
IO: (1, 1), C: (1,)
Foreign debt holdings = 0.2491526796373944
Foreign capital holdings = 0.0526019316518114
resource constraint: [-1.05033517e-11]
Checking constraints on capital, labor, and consumption.
There were no violations of the constraints on labor supply.
There were no violations of the constraints on consumption.
Maximum error in labor FOC = 1.0835776720341528e-13
Maximum error in savings FOC = 9.214851104388799e-14
JUST SAVED SS output to  /Users/richardevans/Docs/Economics/OSE/OG/OG-Core/examples/OG-Core-Example/OUTPUT_REFORM/SS/SS_vars.pkl

REFORM TRANSITION PATH EQUILIBRIUM (1 min 55.6 sec)

Maximum debt ratio:  1.4776192930159575
w diff: 9.373589893169054e-07, -3.3603475557697493e-09
r diff: 5.139618244887068e-10, -1.4544988955617066e-07
r_p diff: 7.088584039194323e-09, -1.4405139817097457e-07
p_m diff: 0.0, 0.0
BQ diff: 1.1068561253310683e-07, -1.615049037518787e-08
TR diff: 4.9495529577670005e-08, -2.9534665763747414e-07
Iteration: 21
Distance: 6.078982216063458e-06
Max absolute value resource constraint error: 8.006040057503827e-07
Checking time path for violations of constraints.
Max Euler error, savings: 4.799605157757014e-12
Max Euler error labor supply: 1.2092549184217205e-12
Time path iteration complete.
It took 115.62044382095337 seconds to get that part done.
run time =  115.62048292160034
total time was  237.77981424331665
Percentage changes in aggregates: Year                    Variable  2021  2022  2023  2024  2025  2026  2027  2028  2029  2030  2021-2030    SS
0                    GDP ($Y_t$) -0.19 -0.18 -0.18 -0.17 -0.15 -0.13 -0.11 -0.08 -0.06 -0.04      -0.13 -0.39
1            Consumption ($C_t$)  0.03 -0.04 -0.11 -0.16 -0.21 -0.25 -0.28 -0.30 -0.32 -0.34      -0.20 -0.72
2          Capital Stock ($K_t$) -0.38 -0.44 -0.49 -0.51 -0.52 -0.52 -0.50 -0.45 -0.42 -0.39      -0.46 -1.51
3                  Labor ($L_t$) -0.09 -0.05 -0.01  0.02  0.05  0.07  0.10  0.11  0.13  0.15       0.05  0.22
4     Real interest rate ($r_t$) -3.08 -2.96 -2.88 -2.81 -2.77 -2.76 -2.74 -2.88 -2.88 -2.89      -2.87 -1.40
5            Wage rate ($w_{t}$) -0.10 -0.14 -0.17 -0.19 -0.20 -0.21 -0.21 -0.20 -0.19 -0.19      -0.18 -0.61

@jdebacker
jdebacker merged commit 181bd18 into jdebacker:FDC_SS Nov 19, 2026
@rickecon
rickecon deleted the jdebacker-FDC_SS branch November 20, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants