Releases: PSLmodels/OG-Core
Releases · PSLmodels/OG-Core
Release list
0.18.0
0.17.0
This release enables new pension systems and makes the following bug fixes:
- Fixes the Defined Benefits and Points System pension paths so they run
against a realSpecificationsobject (Issues #1014 and #1075):
p.retire(an array since PR #433) was passed as the scalarS_ret
into the numba loops, the scalarp.g_ywas indexed as an array inside
the loops, the scalar steady-state wage was indexed as a path, and the
time-varying 3-Dematrix (PR #895) was sliced as 2-D. The systems
use the steady-state retirement age and earnings profile for now; full
time variation remains open in Issue #1014. The same coercions are
applied to the NDC path, but the NDC system additionally requires
growth-rate settings (ndc_growth_rate,dir_growth_rate) that are
not yet parameters indefault_parameters.json, so it still cannot
run against a realSpecificationsobject (see Issue #1169). - Wires the pre-time-path inputs the DB/NDC/PS benefit formulas need
into the TPI: labor supplied before the time path begins comes from
the model's initial condition (the same baseline object that
initializes wealth), and pre-time-path wages are anchored to the
period-0 wage of the current path. Adds the full time-path (T x S x J)
evaluation of Defined Benefits amounts (DB_3dim_loop) used when the
TPI computes aggregate revenues, built from each cohort's own wage and
labor history so aggregates are consistent with household behavior.
With these changes a country model using the Defined Benefits system
solves both the steady state and the transition path. - Adds regression tests that call
pension_amountwith a real
Specificationsobject per pension system (the existing tests
pre-scalarized the inputs and so never exercised the real interface)
and a local-marked steady-state solve test with the Defined Benefits
system. See PR #1167. - Fixes the tax-liability revenue calculation using the first year's tax
noncompliance and filer rates for every period, even when those rates
are set to vary over time (Issue #1168): households responded to the
changing rates while government revenue, the budget, and debt stayed on
the first-year values.income_tax_liabnow slices the rates over the
transition path. See PR #1174. - Fixes the steady-state
etr_ssandmtry_ssdiagnostics using the
labor-income tax noncompliance rate in place of the capital-income rate
(capital_noncompliance_rate_2DinSS.py, Issue #1170). This affects
only the post-solve SS diagnostics -- the solution itself already used
the correct rates -- and is a no-op when the two rates are equal (the
default). See PR #1171. - Fixes
alpha_FA(direct foreign aid, added in 0.16.0) not being
extended over the model time path: it was never registered in
tp_param_list, so a multi-year path stayed short and broke the
transition solve. It now extends toT + Swith the last value carried
forward, likealpha_G/alpha_T/alpha_I. See PR #1166.
0.16.3
This release:
Adds
- Better functionality and more country repositories with the OG installer. See PR #1162
Fixes
- Fixes an inconsistency with the pre-time path population distribution and growth rates. Note that the
demographics.get_popfunction has been changed and now only returns one object: the population distribution (not also the distribution prior to the start year). In addition, theget_popandget_pop_objsfunctions no longer have thepre_pop_distkwarg. See PR #1073.
0.16.2
This release:
Adds
- Adds
output_tables.model_fit_tablefunction that generates a table comparing model output to data for a set of target moments, and adds a test of this function intest_output_tables.py. The function takes as input a list of target moment descriptions, the TPI output dictionary, and the model parameters object, and returns a pandas DataFrame with the target moment descriptions, the model values for those moments, and the data values for those moments (where applicable). The function currently supports a set of macroeconomic moments (interest rate, capital share of output, labor share of output), inequality moments (Gini coefficient for before-tax income and after-tax income), and demographic moments (fraction of population 65+ and population growth rate). See PR #1138. - Validates
beta_annualandchi_bagainstJ. (PR #1149)
Fixes
- Fixes issue with reading UN data on Pandas >= 3.0 and UN token string. (PR #1151)
- Fixes math notation for plot labels. (PR #1148)
- Fixes reshaping issues with
J=1parameterization. (PR #1145) - Fixed math notion for tilde variables in plot labels in
output_plots.pyto be consistent with the documentation and the code. See PR #1148.
0.16.1
This release:
- Adds a
use_sparse_FOC_jacSpecificationsparameter (defaultTrue) that accelerates the time path iteration (TPI) household solve. With it on,scipy.optimize.rootis given a sparse (banded) finite-difference Jacobian for the stacked household Euler and labor first order conditions: the sparsity pattern is auto-detected once per problem size and the solver then needs far fewer function evaluations per Jacobian build (about 20x fewer on the default S=80 cohort solve), with an automatic fallback to dense finite differences if the Jacobian is not sparse enough to benefit or if a solve fails. The result matches the legacy dense-finite-difference solution to within the model's resource-constraint accuracy floor on every calibration tested (OG-Core standard example, OG-ETH, OG-ZAF, OG-PHL, OG-IDN), giving roughly a 1.9-2.4x TPI speedup at no accuracy cost. Setuse_sparse_FOC_jac=Falseto recover bit-identical agreement with v0.16.0 and earlier.
0.16.0
0.15.13
0.15.12
This release:
- Caches the
e_longarray inhousehold.FOC_savingsandhousehold.FOC_laborrather than rebuilding it on every call.e_longis a pure function ofp.e,p.S, andp.J, none of which change during a solve, so a_get_e_longhelper now builds it once per worker and reuses it. Profiling identified this rebuild as the single most expensive operation in a TPI run. The change is a pure cache — model output is bit-for-bit identical to master — and gives roughly a 3x speedup on a single-reform TPI run. See PR #1128. - Builds the per-period tax-parameter slices in
TPI.inner_loopas numpy arrays via a new_params_to_arrayhelper, and switchestxfunc.get_tax_ratestonp.asarray, so the repeated per-call list-to-array conversion is skipped on the hot TPI path.monoandmono2Dtax functions store callables rather than numbers, so their nested-list form is passed through unchanged. Profiling identified this conversion as the next hot spot after thee_longrebuild. Model output is bit-for-bit identical to master, and the change gives roughly a further 10% speedup on a single-reform TPI run (about 3.3x cumulative versus master). See PR #1128. - Changes the minimum of the allowable range for
tau_cindefault_parameters.pyto allow for government consumption subsidies. - Fixes a bug in the
parameter_plots.plot_fert_ratesfunction. See PR #1127.