Anchor bus fare distribution to DfT BUS05ai and NTS0705a - #447
Merged
Conversation
calibrate_bus_fare_spending now applies three anchors: the existing BUS05aii national total, the BUS05ai London/outside-London receipts split within England, and NTS0705a local-bus trip rates by household income quintile, alternated in a small IPF loop that preserves the national total. The LCFS imputation under-captures London fares (Oyster/contactless is poorly separated in diaries), so national-only calibration overstated outside-London fare exposure by ~47% (model London GBP 0.44bn vs BUS05ai GBP 1.35bn). The raw LCFS income gradient also runs opposite to NTS evidence (richer households record more spend; NTS shows Q1 makes ~3.7x the local-bus trips of Q5). Post-build tests validate the built Enhanced FRS via the existing baseline fixture (skipping when the dataset has not been rebuilt), so they run after a rebuild rather than against unbuilt code. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <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.
What changed
calibrate_bus_fare_spendingnow applies three anchors instead of one:Anchors 2 and 3 alternate in a small IPF loop that preserves the national total. Devolved nations are untouched.
Why
This is the published-tables version of anchoring the imputation to the NTS; a follow-up could use NTS trip-level microdata (UKDS) to impute person-level trips directly.
Tests
tests/test_bus_fare_distribution.pyvalidates the built Enhanced FRS via the existingbaselinefixture (skips when the dataset has not been rebuilt), so the assertions run after a rebuild rather than against unbuilt code:🤖 Generated with Claude Code