Skip to content

Update demographic parameters to TxSxJ shape - #12

Open
jdebacker wants to merge 7 commits into
PSLmodels:mainfrom
jdebacker:demog_J
Open

Update demographic parameters to TxSxJ shape#12
jdebacker wants to merge 7 commits into
PSLmodels:mainfrom
jdebacker:demog_J

Conversation

@jdebacker

@jdebacker jdebacker commented Jul 20, 2026

Copy link
Copy Markdown
Member

Summary

Updates the country calibration to match the new (T, S, J)-shaped demographic objects from OG-Core's demog_J branch.

  • Add income_percentiles=p.lambdas.flatten() to both get_pop_objs calls in calibrate.py — required by the updated expand_pop_obj_J function
  • Sum omega_SS over the J dimension before passing to get_e_interp, which expects 1-D age weights
  • Regenerate ogbra_default_parameters.json with the new demographic array shapes:
    • omega, rho, imm_rates: (400, 80, 7) (was (400, 80))
    • omega_SS, rho_preTP, imm_rates_preTP, omega_S_preTP: (80, 7) (was (80,) or absent)
    • g_n_ss, g_n_preTP: new scalar entries
    • g_n: (400,) unchanged

Depends on: OG-Core demog_J branch

Test plan

  • Verify ogbra_default_parameters.json loads correctly with the updated OG-Core
  • Run ogbra unit tests once OG-Core demog_J is merged and installed

🤖 Generated with Claude Code

jdebacker and others added 6 commits July 19, 2026 21:22
Add income_percentiles=p.lambdas.flatten() to get_pop_objs calls so
demographics now returns (T, S, J)-shaped arrays for omega, rho, and
imm_rates. Also sum omega_SS over J before passing to get_e_interp,
which expects 1-D age weights.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pass demog80["omega_SS"] (shape S x J) directly to get_e_interp instead
of summing over J first.  In income.py, replace the
  omega_SS.reshape(S, 1) * lambdas.reshape(1, J)
pattern with plain omega_SS, since the joint age-income distribution is
now stored directly in omega_SS rather than being reconstructed from
the marginal age distribution and lambdas.

The utils.Inequality class already handles 2-D pop_weights natively,
so those call sites need no change.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.60%. Comparing base (92b03ef) to head (6ced4bf).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
ogbra/income.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #12   +/-   ##
=======================================
  Coverage   86.60%   86.60%           
=======================================
  Files          15       15           
  Lines         687      687           
=======================================
  Hits          595      595           
  Misses         92       92           
Flag Coverage Δ
unittests 86.60% <80.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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