Skip to content

Conversation

@MaxGhenis
Copy link
Collaborator

Summary

  • Move stochastic variable generation from country package to data package
  • Variables now read pre-computed values from datasets for deterministic, reproducible calculations
  • is_higher_earner uses age as deterministic tie-breaker instead of random noise

Changes

Variable Change
would_claim_pc Remove formula, use default_value = True
would_claim_uc Remove formula, use default_value = True
would_claim_child_benefit Remove formula, use default_value = True
child_benefit_opts_out Remove formula, use default_value = False
would_evade_tv_licence_fee Remove formula, use default_value = False
household_owns_tv Remove formula, use default_value = True
main_residential_property_purchased_is_first_home Remove formula, use default_value = False
is_disabled_for_benefits Remove formula, use default_value = False
would_claim_marriage_allowance New variable for take-up decision
marriage_allowance Use would_claim_marriage_allowance instead of random()
attends_private_school Use pre-generated random draw from dataset
is_higher_earner Use age as deterministic tie-breaker

Related PRs

  • policyengine-uk-data#246: Adds stochastic variable generation to data package

Test plan

  • CI passes
  • Manual testing with dataset confirms deterministic results

🤖 Generated with Claude Code

Move stochastic variable generation to data package. Variables now read
pre-computed values from datasets for deterministic, reproducible
calculations.

Changes:
- would_claim_pc, would_claim_uc, would_claim_child_benefit,
  child_benefit_opts_out, would_evade_tv_licence_fee, household_owns_tv,
  main_residential_property_purchased_is_first_home,
  is_disabled_for_benefits: Remove formulas, use default_value
- would_claim_marriage_allowance: New variable for take-up decision
- marriage_allowance: Use would_claim_marriage_allowance instead of random()
- attends_private_school: Use pre-generated random draw from dataset
- is_higher_earner: Use age as deterministic tie-breaker instead of random()

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

Co-Authored-By: Claude <noreply@anthropic.com>
MaxGhenis and others added 2 commits December 3, 2025 17:56
Tests verify:
- Default values work correctly in policy calculator mode
- Variables can be explicitly overridden in situations
- is_higher_earner uses deterministic tie-breaking (older wins)
- Calculations are deterministic across multiple runs

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

Co-Authored-By: Claude <noreply@anthropic.com>
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.

2 participants