Skip to content

Add rail_usage variable derived from rail_subsidy_spending#227

Merged
MaxGhenis merged 3 commits into
mainfrom
add-rail-usage-variable
Nov 27, 2025
Merged

Add rail_usage variable derived from rail_subsidy_spending#227
MaxGhenis merged 3 commits into
mainfrom
add-rail-usage-variable

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Summary

Adds a rail_usage variable to the dataset representing rail usage quantity at base year (2020) prices.

Implementation

rail_usage = rail_subsidy_spending / RAIL_FARE_INDEX_SURVEY_YEAR

Where RAIL_FARE_INDEX_SURVEY_YEAR = 1.010 (the 2021 fare index from policyengine-uk).

Why This Matters

This enables policyengine-uk PR #1406 to properly decompose rail spending into price × quantity:

rail_subsidy_spending = rail_usage × fare_index

Without this change, the policyengine-uk formula would be a tautology:

  • rail_usage = spending / fare_index (computed each year)
  • rail_subsidy_spending = rail_usage × fare_index = spending (no change!)

With this change, rail_usage is derived once at the survey year and stored in the dataset. This allows reforms to modify fare_index and see actual effects on rail_subsidy_spending.

Use Case

The Autumn Budget 2025 rail fares freeze policy freezes fares in 2026 while ridership continues to grow. Proper price × quantity decomposition enables:

  • Accurate modeling of fare changes via fare_index parameter
  • Ridership growth via uprating rail_usage
  • Treasury-consistent cost estimates

Related

🤖 Generated with Claude Code

MaxGhenis and others added 3 commits November 27, 2025 12:49
Derives rail_usage (quantity at base year prices) from rail_subsidy_spending
by dividing by the fare index for the survey year (2021):

  rail_usage = rail_subsidy_spending / 1.010

This enables policyengine-uk to properly decompose rail spending into
price × quantity, allowing reforms to modify the fare_index parameter
independently of usage quantity.

Related: PolicyEngine/policyengine-uk#1406
Fixes: #226

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Import system from policyengine_uk to access parameters
- Add get_fare_index_survey_year() function that tries to read
  gov.dft.rail.fare_index from parameters, falls back to 1.010
- This allows the code to work both before and after policyengine-uk
  PR #1406 is merged

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@MaxGhenis MaxGhenis merged commit 3290dcf into main Nov 27, 2025
3 checks passed
@MaxGhenis MaxGhenis deleted the add-rail-usage-variable branch November 27, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant