You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Constituency and local-authority simulations get no UC deductions or private school attendance #1902
uc_deduction_random_draw, uc_deduction_type_random_draw and attends_private_school choose between microdata imputation and single-household defaults by testing whether total weight is below 1e6:
policyengine_uk/variables/gov/dwp/universal_credit/deductions/uc_deduction_random_draw.py: benunit_weight.sum() < 1e6 gives a draw of 1.0, so no UC deductions.
policyengine_uk/variables/gov/dwp/universal_credit/deductions/uc_deduction_type_random_draw.py: the same test.
policyengine_uk/variables/contrib/labour/attends_private_school.py: household_weight.sum() < 1e6 gives no private school attendance.
policyengine.py builds constituency and local-authority simulations by filtering rows from the national dataset:
src/policyengine/countries/uk/regions.py uses RowFilterStrategy on constituency_code_oa / la_code_oa.
src/policyengine/utils/entity_utils.pyfilter_dataset_by_household_ids keeps rows without rescaling weights.
src/policyengine/tax_benefit_models/uk/model.pyrun() wraps the filtered tables in UKSingleYearDataset and calls Microsimulation.
A constituency carries roughly 8k to 380k benefit units of weight, so every constituency and local-authority run gets household defaults. Those runs model no UC deductions at all and no private school attendance, including under a private school VAT reform. Northern Ireland as a filtered region carries 0.996m benefit units of weight (enhanced FRS 2024-25), just under the threshold.
#1899 adds Simulation.built_from_dataset, which is true for any simulation built from data. It stays true for a subset filtered from the data, so these variables can gate on how the simulation was built rather than on its weight.
Activity