Repository navigation
Anchor the Microcosm primary's ageing at its 2025 calibration year - #40
Merged
Merged
Conversation
The a133f37a registry entry anchored static ageing at the 2024 data year, saying no calibration year was declared for the cut. Its own build says otherwise: it solves the household weights at 2025 and writes them at the data year divided by policyengine-uk's 2024-to-2025 projection of household_weight (build_record.json export readback weight_year: dataset 2024, solve 2025, factor 1.0072; microcosm weight_year.py, #796 A19), and calibration_diagnostics.json dates all 1,259 targets 2025. So the model's 2025 weights are the solved ones, as the Enhanced FRS's are its calibrated ones, and a 2024 anchor made the rake replace them with 2024 weights grown by ONS cell growth. The anchor is now 2025, as the registry's rule (a build's calibration year is its anchor) requires. A new test holds that rule for every registry entry. No binding Microcosm run exists yet, so no result moves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
MaxGhenis
added a commit
that referenced
this pull request
Oct 25, 2026
Cherry-picks #40 (4edb1c0) onto the bind, and applies the same correction to d2011's a6299504. Each build solves its household weights at 2025 and writes them at the 2024 data year divided by policyengine-uk's own 2024-to-2025 projection (build_record.json export readback weight_year: dataset 2024, solve 2025, factor 1.0072; microcosm weight_year.py, #796 A19). Its calibration_diagnostics.json dates every target 2025 (1,259 for a133f37a, 1,268 for a6299504). So the model's 2025 weights are the solved ones, and the registry's rule (a build's calibration year is its anchor) puts both anchors at 2025. a133f37a's entry had said no calibration year was declared. A new test holds that rule for every registry entry. No binding Microcosm run exists yet, so no result moves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… weights are calibrated x 0.9956 Review of 4edb1c0: the release wording and the a133 registry note called both datasets' 2025 weights the calibrated ones, but METHOD.md's Enhanced FRS level note (policyengine-uk-data#538) gives runtime = calibrated x 0.9956. demography's module note still said the binding Microcosm cut anchors at 2024. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of 8901d55: demography's note gave the identity to every Microcosm cut, but 5c6b3f68 (built at microcosm 64c460b) predates #1095's division by the model's projection factor, so its 2025 weights are its solved ones times 1.0072. METHOD's level note and CALIBRATION_ANCHOR's superseded note now say which builds divide, and that 5c6b3f68 also anchors at 2025 (since 95732e2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis
marked this pull request as ready for review
October 26, 2026 04:18
Contributor
Author
|
Merge audit (head
🤖 Generated with Claude Code |
This branch was successfully deployed
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.
Draft; round-3 review pending at 7a9afa2. This corrects the Microcosm primary's static-ageing anchor from 2024 to 2025, its calibration year. It's a fact error in the a133f37a registry entry from #37, not a change of method.
The bug
The registry's rule (METHOD.md, Household weights; the
datasets.DATASETScomment) is that a dataset anchors at its build's calibration year. The rake keeps the dataset's own weights through the anchor, so it never moves the calibrated weights. #37 anchoredmicrocosm_uk_2024_25@a133f37aat its 2024 data year, saying "no calibration year is declared for this cut". The cut's own release says otherwise:build_record.json,uk_national_export_readback:weight_year: {dataset_year: 2024, solve_year: 2025, engine_projection_factor: 1.0072}.weight_year.py(microcosm#796 A19): the release writes the solved household weights divided by policyengine-uk's own projection ofhousehold_weightfrom the dataset year to the solve year, "so the engine returns the solved weights at the solve year". It is the same mechanism as the Enhanced FRS, without uk-data#538's offset.calibration_diagnostics.json(in the release): all 1,259 targets are dated 2025;run_config.calibration_yearis 2025.So the model's 2025 weights are a133f37a's calibrated weights. With a 2024 anchor, the rake replaced them, and every later year's, with the 2024 weights grown by ONS age/sex cell growth. That is the move the rule exists to prevent.
The fix
ageing_anchorfor a133f37a:{year: 2025, calibration_year: 2025}, citing the evidence above.pipeline.method_limitations),engine.py's anddemography's notes (resolve_anchorand the module docstring), METHOD.md (outside the frozen C2 section) and a superseded note in CALIBRATION_ANCHOR.md.demography.populationalready adds the anchor year to the years it builds, as for the Enhanced FRS.d2011's a6299504 cut (#39) has the same build record (
solve_year2025, factor 1.0072, all 1,268 targets dated 2025), so #39 takes the same anchor.Impact
No binding Microcosm run exists: #715's pair is unreleased, and the bridge's data step has not run. The published pre-Budget release used Enhanced FRS 1.58.0, already anchored at 2025, and its receipts are unchanged. So no published or recorded result moves. The binding rebuild's Microcosm weights in 2025 and later change from ONS-raked 2024 weights to the calibrated 2025 weights raked from 2025.
Invariants
datasets.DATASETS).test_demography; it is now also checked on the invented Microcosm-style dataset for both 2024 and 2025.Verification
All on the locked UK 2.147.2 / core 3.33.3 environment.
test_datasets,test_microcosm_primary,test_c2_screen,test_demography: 110 passed. The frozen C2 section is byte-identical to main.test_microcosm_primaryandtest_datasets: 32 passed. CI: Pipeline and Dashboard pass.test_microcosm_primaryandtest_datasets: 26 passed.test_ageing_model,test_ageing_report,test_c2_screen,test_datasets,test_demography,test_engine_pure,test_hb_allowance_diagnostic,test_matched_total_driver,test_microcosm_primary,test_model_v2_determinism,test_quoted_sensitivity,test_results,test_rules,test_scenarios,test_state_pension_age_addition,test_uncertainty): 692 passed, 3 failed. The 3 are the documented pre-build stale-results checks thatscripts/check_prebuild_tests.pyadmits (test_results::test_not_stale,test_results::test_assumptions_block_is_current,test_scenarios::test_not_stale), each with its admitted message. The committed outputs predate the binding rebuild, as on main.🤖 Generated with Claude Code