Update demographic parameters to TxSxJ shape#12
Open
jdebacker wants to merge 2 commits into
Open
Conversation
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>
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.
Summary
Updates the country calibration to match the new
(T, S, J)-shaped demographic objects from OG-Core'sdemog_Jbranch.income_percentiles=p.lambdas.flatten()to bothget_pop_objscalls incalibrate.py— required by the updatedexpand_pop_obj_Jfunctionomega_SSover the J dimension before passing toget_e_interp, which expects 1-D age weightsogbra_default_parameters.jsonwith 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 entriesg_n:(400,)unchangedDepends on: OG-Core
demog_JbranchTest plan
ogbra_default_parameters.jsonloads correctly with the updated OG-Coreogbraunit tests once OG-Coredemog_Jis merged and installed🤖 Generated with Claude Code