Skip to content

Test equivalisation factors and read scale from parameters (#307)#1663

Open
vahid-ahmadi wants to merge 1 commit intomainfrom
vahid-ahmadi/issue-307-equivalisation-tests
Open

Test equivalisation factors and read scale from parameters (#307)#1663
vahid-ahmadi wants to merge 1 commit intomainfrom
vahid-ahmadi/issue-307-equivalisation-tests

Conversation

@vahid-ahmadi
Copy link
Copy Markdown
Collaborator

Summary

Closes #307. Adds YAML coverage for the two equivalisation formulas against the worked examples in the HBAI quality and methodology report. Six test cases covering the modified-OECD scale: single adult, couple, couple with one young child (<14), couple with one older child (14+), couple with both, and lone parent with two young children.

While writing the tests I noticed household_equivalisation_bhc and household_equivalisation_ahc were hard-coding the scale weights (0.67/0.33/0.2 and 0.58/0.42/0.2) even though matching parameter files already exist under household/demographic/equiv/{bhc,ahc}/{first_adult,second_adult,child_over_14,child_under_14}.yaml. Wired the formulas to read those parameters — values match exactly so behaviour is unchanged, but the scale is now reform-tunable and the magic numbers are gone.

Test plan

  • policyengine-core test policyengine_uk/tests/policy/baseline/household/demographic/equivalisation.yaml -c policyengine_uk — 6 cases pass.
  • Full policy suite still passes — policyengine-core test policyengine_uk/tests/policy -c policyengine_uk reports 1006 passed.

🤖 Generated with Claude Code

Adds YAML coverage for `household_equivalisation_bhc` and
`household_equivalisation_ahc` against the HBAI modified-OECD scale
(single adult, couple, couple with young/older children, lone parent).

Both formulas were hard-coding the scale weights even though matching
parameters already exist under `household.demographic.equiv.{bhc,ahc}`.
Wired the formulas to read those parameters — values are unchanged, so
the existing 1006 policy tests still pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vahid-ahmadi vahid-ahmadi self-assigned this May 6, 2026
@vahid-ahmadi vahid-ahmadi requested a review from MaxGhenis May 6, 2026 11:30
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.

Test equivalisation factors

1 participant