Better handle the pre-time path population distribution#1073
Better handle the pre-time path population distribution#1073jdebacker wants to merge 17 commits intoPSLmodels:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1073 +/- ##
==========================================
+ Coverage 72.92% 73.01% +0.09%
==========================================
Files 21 21
Lines 5122 5100 -22
==========================================
- Hits 3735 3724 -11
+ Misses 1387 1376 -11
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
All local tests pass: |
|
When running the OG-USA example (and updating the demographic parameters), I find the following resource constraint issues: OG-Core built from the
|
|
@rickecon Can you review these changes and see if you can pinpoint where the new RC errors are coming from? I've gone over these changes manually several time and have had Codex and Claude Code agents trying to diagnose, but not luck. Here's what my run of OG-USA with updated demographics looks like (snippet of how set the baseline, which is the only thing of interest here): """
---------------------------------------------------------------------------
Run baseline policy
---------------------------------------------------------------------------
"""
# Set up baseline parameterization
p = Specifications(
baseline=True,
num_workers=num_workers,
baseline_dir=base_dir,
output_base=base_dir,
)
# Update parameters for baseline from default json file
with importlib.resources.open_text(
"ogusa", "ogusa_default_parameters.json"
) as file:
defaults = json.load(file)
p.update_specifications(defaults)
p.tax_func_type = "HSV"
p.age_specific = True
c = Calibration(p, estimate_tax_functions=False, estimate_pop=True, client=client)
d = c.get_dict()
# # additional parameters to change
updated_params = {
"omega_S_preTP": d["omega_S_preTP"],
"omega_SS": d["omega_SS"],
"omega": d["omega"],
"g_n_ss": d["g_n_ss"],
"rho": d["rho"],
"g_n": d["g_n"],
"imm_rates": d["imm_rates"],
"g_n_preTP": d["g_n_preTP"],
"imm_rates_preTP": d["imm_rates_preTP"],
"rho_preTP": d["rho_preTP"],
}
p.update_specifications(updated_params)
# Run model
start_time = time.time()
runner(p, time_path=True, client=client)
print("run time = ", time.time() - start_time) |
The population distribution before the start year of the model is necessary to compute savings and bequests in period 0.
This PR adds explicitly the parameters for mortality, immigration, and population growth rates from period 0 to period 1 in order to make for a consistent transition from this "pre model period" to period 0.
cc @rickecon