Conversation
|
Split this work into two draft PRs so the general calibration-contract changes can be reviewed independently from the provisional OACT source package. The stacked follow-up is #670. |
|
Follow-up from the late-tail investigation:
Substantively, the new diagnostics clarify the late-year problem:
So the current read is:
I have not pushed the experimental dense approximate entropy fallback yet. The first prototype failed numerically on |
|
Late-tail update from the microsim-only investigation:
Important caveat: this is not the whole tail fix by itself. The LP approximate fallback is still overly sparse, and the deeper ESS/concentration problem remains. But this change improves the late-year feasible set with a defensible repeated-cross-section adjustment rather than another hidden tolerance bump. I have not included the standalone support-profiling script in this commit yet; it is still local-only while I decide whether it belongs in the repo. |
Summary
What changed
CalibrationProfilecontracts for long-run age/SS/payroll/TOB calibration, including year-bounded approximate windowscalibration_quality,max_constraint_pct_error, and target-source metadataassess_calibration_frontier.pyfor checking where exact nonnegative calibration remains feasiblerebuild_calibration_manifest.pyto backfill manifests/sidecars with the new contract datatrustees_2025_current_lawlong-run target-source package instead of relying on an implicit legacy file pathWhy
The old long-run workflow depended on implicit flag combinations, silent fallback behavior, and ambiguous target-source provenance. This PR makes the calibration contract explicit and inspectable so downstream consumers can reject mismatched artifacts instead of trusting them implicitly.
Validation
uv run pytest policyengine_us_data/tests/test_long_term_calibration_contract.py -qpython3 -m py_compile policyengine_us_data/datasets/cps/long_term/calibration.py policyengine_us_data/datasets/cps/long_term/calibration_profiles.py policyengine_us_data/datasets/cps/long_term/calibration_artifacts.py policyengine_us_data/datasets/cps/long_term/run_household_projection.py policyengine_us_data/datasets/cps/long_term/ssa_data.py policyengine_us_data/datasets/cps/long_term/rebuild_calibration_manifest.py policyengine_us_data/datasets/cps/long_term/assess_calibration_frontier.pyFollow-up
A stacked follow-up PR will add the provisional OACT target-source package and builder script on top of this contract work.