policyengine-uk 2.40.1__py3-none-any.whl → 2.65.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. policyengine_uk/__init__.py +5 -3
  2. policyengine_uk/data/__init__.py +1 -0
  3. policyengine_uk/data/dataset_schema.py +70 -18
  4. policyengine_uk/data/economic_assumptions.py +36 -10
  5. policyengine_uk/data/filter_dataset.py +52 -0
  6. policyengine_uk/dynamics/labour_supply.py +343 -0
  7. policyengine_uk/dynamics/participation.py +629 -0
  8. policyengine_uk/dynamics/progression.py +384 -0
  9. policyengine_uk/microsimulation.py +105 -0
  10. policyengine_uk/model_api.py +1 -0
  11. policyengine_uk/parameters/gov/boe/base_rate.yaml +34 -0
  12. policyengine_uk/parameters/gov/boe/index.yaml +2 -0
  13. policyengine_uk/parameters/gov/contrib/behavioral_responses/employee_salary_sacrifice_reduction_rate.yaml +14 -0
  14. policyengine_uk/parameters/gov/contrib/behavioral_responses/salary_sacrifice_broad_base_haircut_rate.yaml +22 -0
  15. policyengine_uk/parameters/gov/contrib/cec/state_pension_increase.yaml +1 -1
  16. policyengine_uk/parameters/gov/contrib/ubi_center/carbon_tax.yaml +2 -2
  17. policyengine_uk/parameters/gov/contrib/ubi_center/land_value_tax.yaml +3 -3
  18. policyengine_uk/parameters/gov/dcms/bbc/tv_licence/colour.yaml +5 -5
  19. policyengine_uk/parameters/gov/dfe/education_spending.yaml +1 -1
  20. policyengine_uk/parameters/gov/dft/rail/fare_index.yaml +32 -0
  21. policyengine_uk/parameters/gov/dft/rail/prior_law_fare_index.yaml +32 -0
  22. policyengine_uk/parameters/gov/dft/rail/ridership_index.yaml +30 -0
  23. policyengine_uk/parameters/gov/dft/spending.yaml +2 -2
  24. policyengine_uk/parameters/gov/dwp/ESA/income/earn_disregard.yaml +1 -1
  25. policyengine_uk/parameters/gov/dwp/ESA/income/income_disregard_couple.yaml +1 -1
  26. policyengine_uk/parameters/gov/dwp/ESA/income/income_disregard_lone_parent.yaml +1 -1
  27. policyengine_uk/parameters/gov/dwp/ESA/income/income_disregard_single.yaml +1 -1
  28. policyengine_uk/parameters/gov/dwp/ESA/income/pension_disregard.yaml +1 -1
  29. policyengine_uk/parameters/gov/dwp/IIDB/maximum.yaml +1 -1
  30. policyengine_uk/parameters/gov/dwp/JSA/contrib/amount_over_25.yaml +1 -1
  31. policyengine_uk/parameters/gov/dwp/JSA/contrib/earn_disregard.yaml +1 -1
  32. policyengine_uk/parameters/gov/dwp/JSA/contrib/pension_disregard.yaml +1 -1
  33. policyengine_uk/parameters/gov/dwp/JSA/income/amount_18_24.yaml +7 -7
  34. policyengine_uk/parameters/gov/dwp/JSA/income/amount_over_25.yaml +7 -7
  35. policyengine_uk/parameters/gov/dwp/JSA/income/income_disregard_couple.yaml +1 -1
  36. policyengine_uk/parameters/gov/dwp/JSA/income/income_disregard_lone_parent.yaml +1 -1
  37. policyengine_uk/parameters/gov/dwp/JSA/income/income_disregard_single.yaml +1 -1
  38. policyengine_uk/parameters/gov/dwp/LHA/shared_accommodation_age_threshold.yaml +12 -0
  39. policyengine_uk/parameters/gov/dwp/attendance_allowance/higher.yaml +7 -7
  40. policyengine_uk/parameters/gov/dwp/attendance_allowance/lower.yaml +7 -7
  41. policyengine_uk/parameters/gov/dwp/benefit_cap.yaml +3 -3
  42. policyengine_uk/parameters/gov/dwp/carer_premium/couple.yaml +2 -2
  43. policyengine_uk/parameters/gov/dwp/carer_premium/single.yaml +6 -6
  44. policyengine_uk/parameters/gov/dwp/carers_allowance/rate.yaml +7 -7
  45. policyengine_uk/parameters/gov/dwp/disability_premia/disability_couple.yaml +1 -1
  46. policyengine_uk/parameters/gov/dwp/disability_premia/enhanced_couple.yaml +1 -1
  47. policyengine_uk/parameters/gov/dwp/disability_premia/enhanced_single.yaml +1 -1
  48. policyengine_uk/parameters/gov/dwp/disability_premia/severe_couple.yaml +1 -1
  49. policyengine_uk/parameters/gov/dwp/dla/mobility/higher.yaml +4 -4
  50. policyengine_uk/parameters/gov/dwp/dla/mobility/lower.yaml +8 -8
  51. policyengine_uk/parameters/gov/dwp/dla/self_care/higher.yaml +7 -7
  52. policyengine_uk/parameters/gov/dwp/dla/self_care/lower.yaml +8 -8
  53. policyengine_uk/parameters/gov/dwp/dla/self_care/middle.yaml +7 -7
  54. policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/lone_parent/aged.yaml +1 -1
  55. policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/lone_parent/older.yaml +3 -3
  56. policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/single/aged.yaml +1 -1
  57. policyengine_uk/parameters/gov/dwp/housing_benefit/allowances/single/older.yaml +3 -3
  58. policyengine_uk/parameters/gov/dwp/housing_benefit/means_test/income_disregard/worker.yaml +1 -1
  59. policyengine_uk/parameters/gov/dwp/housing_benefit/non_dep_deduction/amount.yaml +1 -1
  60. policyengine_uk/parameters/gov/dwp/housing_benefit/takeup.yaml +7 -7
  61. policyengine_uk/parameters/gov/dwp/income_support/amounts/amount_16_24.yaml +1 -1
  62. policyengine_uk/parameters/gov/dwp/income_support/amounts/amount_couples_over_18.yaml +1 -1
  63. policyengine_uk/parameters/gov/dwp/income_support/means_test/earn_disregard.yaml +1 -1
  64. policyengine_uk/parameters/gov/dwp/income_support/means_test/income_disregard_couple.yaml +1 -1
  65. policyengine_uk/parameters/gov/dwp/income_support/means_test/income_disregard_lone_parent.yaml +1 -1
  66. policyengine_uk/parameters/gov/dwp/income_support/means_test/income_disregard_single.yaml +1 -1
  67. policyengine_uk/parameters/gov/dwp/income_support/means_test/pension_disregard.yaml +1 -1
  68. policyengine_uk/parameters/gov/dwp/income_support/takeup.yaml +7 -7
  69. policyengine_uk/parameters/gov/dwp/pension_credit/guarantee_credit/carer/addition.yaml +4 -4
  70. policyengine_uk/parameters/gov/dwp/pension_credit/guarantee_credit/minimum_guarantee.yaml +9 -9
  71. policyengine_uk/parameters/gov/dwp/pension_credit/guarantee_credit/severe_disability/addition.yaml +3 -3
  72. policyengine_uk/parameters/gov/dwp/pension_credit/savings_credit/threshold.yaml +5 -5
  73. policyengine_uk/parameters/gov/dwp/pip/daily_living/enhanced.yaml +7 -7
  74. policyengine_uk/parameters/gov/dwp/pip/daily_living/standard.yaml +8 -8
  75. policyengine_uk/parameters/gov/dwp/pip/mobility/enhanced.yaml +4 -4
  76. policyengine_uk/parameters/gov/dwp/pip/mobility/standard.yaml +9 -9
  77. policyengine_uk/parameters/gov/dwp/sda/maximum.yaml +7 -7
  78. policyengine_uk/parameters/gov/dwp/state_pension/basic_state_pension/amount.yaml +11 -11
  79. policyengine_uk/parameters/gov/dwp/state_pension/new_state_pension/amount.yaml +4 -4
  80. policyengine_uk/parameters/gov/dwp/tax_credits/child_tax_credit/limit/child_count.yaml +10 -1
  81. policyengine_uk/parameters/gov/dwp/tax_credits/child_tax_credit/takeup.yaml +7 -7
  82. policyengine_uk/parameters/gov/dwp/tax_credits/working_tax_credit/takeup.yaml +7 -7
  83. policyengine_uk/parameters/gov/dwp/universal_credit/elements/carer/amount.yaml +3 -3
  84. policyengine_uk/parameters/gov/dwp/universal_credit/elements/child/amount.yaml +2 -4
  85. policyengine_uk/parameters/gov/dwp/universal_credit/elements/child/disabled/amount.yaml +2 -4
  86. policyengine_uk/parameters/gov/dwp/universal_credit/elements/child/first/higher_amount.yaml +6 -8
  87. policyengine_uk/parameters/gov/dwp/universal_credit/elements/child/limit/child_count.yaml +6 -1
  88. policyengine_uk/parameters/gov/dwp/universal_credit/elements/child/severely_disabled/amount.yaml +3 -5
  89. policyengine_uk/parameters/gov/dwp/universal_credit/elements/childcare/cap.yaml +2 -6
  90. policyengine_uk/parameters/gov/dwp/universal_credit/elements/disabled/amount.yaml +4 -6
  91. policyengine_uk/parameters/gov/dwp/universal_credit/elements/housing/non_dep_deduction/amount.yaml +4 -1
  92. policyengine_uk/parameters/gov/dwp/universal_credit/rebalancing/active.yaml +9 -0
  93. policyengine_uk/parameters/gov/dwp/universal_credit/rebalancing/new_claimant_health_element.yaml +9 -0
  94. policyengine_uk/parameters/gov/dwp/universal_credit/rebalancing/standard_allowance_uplift.yaml +13 -0
  95. policyengine_uk/parameters/gov/dwp/universal_credit/standard_allowance/amount.yaml +5 -5
  96. policyengine_uk/parameters/gov/dwp/winter_fuel_payment/eligibility/taxable_income_test/maximum_taxable_income.yaml +2 -1
  97. policyengine_uk/parameters/gov/dwp/winter_fuel_payment/eligibility/taxable_income_test/use_maximum_taxable_income.yaml +1 -0
  98. policyengine_uk/parameters/gov/dynamic/obr_labour_supply_assumptions.yaml +9 -0
  99. policyengine_uk/parameters/gov/economic_assumptions/create_economic_assumption_indices.py +1 -1
  100. policyengine_uk/parameters/gov/economic_assumptions/yoy_growth.yaml +522 -153
  101. policyengine_uk/parameters/gov/hmrc/cgt/additional_rate.yaml +5 -0
  102. policyengine_uk/parameters/gov/hmrc/cgt/basic_rate.yaml +5 -0
  103. policyengine_uk/parameters/gov/hmrc/cgt/higher_rate.yaml +4 -0
  104. policyengine_uk/parameters/gov/hmrc/child_benefit/amount/additional.yaml +6 -6
  105. policyengine_uk/parameters/gov/hmrc/child_benefit/amount/eldest.yaml +8 -8
  106. policyengine_uk/parameters/gov/hmrc/child_benefit/takeup/by_age.yaml +1 -1
  107. policyengine_uk/parameters/gov/hmrc/fuel_duty/calculate_fuel_duty_rates.py +464 -0
  108. policyengine_uk/parameters/gov/hmrc/fuel_duty/petrol_and_diesel.yaml +86 -10
  109. policyengine_uk/parameters/gov/hmrc/income_tax/allowances/personal_allowance/amount.yaml +6 -0
  110. policyengine_uk/parameters/gov/hmrc/income_tax/earned_taxable_income_exclusions.yaml +2 -1
  111. policyengine_uk/parameters/gov/hmrc/income_tax/income_tax_additions.yaml +1 -0
  112. policyengine_uk/parameters/gov/hmrc/income_tax/rates/dividends.yaml +12 -0
  113. policyengine_uk/parameters/gov/hmrc/income_tax/rates/property.yaml +46 -0
  114. policyengine_uk/parameters/gov/hmrc/income_tax/rates/savings.yaml +46 -0
  115. policyengine_uk/parameters/gov/hmrc/income_tax/rates/scotland/rates.yaml +2 -2
  116. policyengine_uk/parameters/gov/hmrc/income_tax/rates/uk.yaml +14 -2
  117. policyengine_uk/parameters/gov/hmrc/national_insurance/class_1/rates/employee/additional.yaml +4 -6
  118. policyengine_uk/parameters/gov/hmrc/national_insurance/class_1/rates/employer.yaml +3 -3
  119. policyengine_uk/parameters/gov/hmrc/national_insurance/class_1/thresholds/secondary_threshold.yaml +14 -4
  120. policyengine_uk/parameters/gov/hmrc/national_insurance/class_2/flat_rate.yaml +2 -2
  121. policyengine_uk/parameters/gov/hmrc/national_insurance/salary_sacrifice_pension_cap.yaml +16 -0
  122. policyengine_uk/parameters/gov/hmrc/student_loans/interest_rates/index.yaml +12 -0
  123. policyengine_uk/parameters/gov/hmrc/student_loans/interest_rates/plan_1/boe_margin.yaml +11 -0
  124. policyengine_uk/parameters/gov/hmrc/student_loans/interest_rates/plan_2/additional_rate.yaml +27 -0
  125. policyengine_uk/parameters/gov/hmrc/student_loans/interest_rates/plan_2/index.yaml +16 -0
  126. policyengine_uk/parameters/gov/hmrc/student_loans/interest_rates/plan_2/upper_threshold.yaml +48 -0
  127. policyengine_uk/parameters/gov/hmrc/student_loans/interest_rates/postgraduate_additional_rate.yaml +11 -0
  128. policyengine_uk/parameters/gov/hmrc/student_loans/postgraduate_repayment_rate.yaml +9 -0
  129. policyengine_uk/parameters/gov/hmrc/student_loans/repayment_rate.yaml +9 -0
  130. policyengine_uk/parameters/gov/hmrc/student_loans/thresholds/plan_1.yaml +25 -0
  131. policyengine_uk/parameters/gov/hmrc/student_loans/thresholds/plan_2.yaml +58 -0
  132. policyengine_uk/parameters/gov/hmrc/student_loans/thresholds/plan_4.yaml +19 -0
  133. policyengine_uk/parameters/gov/hmrc/student_loans/thresholds/plan_5.yaml +16 -0
  134. policyengine_uk/parameters/gov/hmrc/student_loans/thresholds/postgraduate.yaml +21 -0
  135. policyengine_uk/parameters/gov/hmrc/vat/reduced_rate_share.yaml +3 -3
  136. policyengine_uk/parameters/gov/indices/private_rent_index.yaml +9 -9
  137. policyengine_uk/parameters/gov/revenue_scotland/lbtt/non_residential.yaml +2 -2
  138. policyengine_uk/parameters/gov/revenue_scotland/lbtt/rent.yaml +2 -2
  139. policyengine_uk/parameters/gov/revenue_scotland/lbtt/residential/first_time_buyer_rate.yaml +2 -2
  140. policyengine_uk/parameters/gov/revenue_scotland/lbtt/residential/rate.yaml +2 -2
  141. policyengine_uk/parameters/gov/wra/land_transaction_tax/non_residential.yaml +2 -2
  142. policyengine_uk/parameters/gov/wra/land_transaction_tax/rent.yaml +2 -2
  143. policyengine_uk/parameters/gov/wra/land_transaction_tax/residential/higher_rate.yaml +1 -1
  144. policyengine_uk/parameters/gov/wra/land_transaction_tax/residential/primary.yaml +2 -2
  145. policyengine_uk/parameters/household/consumption/carbon/consumption.yaml +8 -6
  146. policyengine_uk/parameters/household/consumption/carbon/intensity.yaml +4 -1
  147. policyengine_uk/parameters/household/consumption/carbon/production.yaml +12 -7
  148. policyengine_uk/parameters/household/consumption/carbon/production_by_source.yaml +76 -41
  149. policyengine_uk/parameters/household/consumption/fuel/prices/petrol.yaml +1 -1
  150. policyengine_uk/parameters/household/poverty/absolute_poverty_threshold_bhc.yaml +1 -1
  151. policyengine_uk/reforms/policyengine/adjust_budgets.py +0 -1
  152. policyengine_uk/scenarios/__init__.py +4 -0
  153. policyengine_uk/scenarios/pip_reform.py +23 -0
  154. policyengine_uk/scenarios/reindex_benefit_cap.py +32 -0
  155. policyengine_uk/scenarios/repeal_two_child_limit.py +10 -0
  156. policyengine_uk/scenarios/uc_reform.py +50 -0
  157. policyengine_uk/simulation.py +619 -0
  158. policyengine_uk/system.py +3 -257
  159. policyengine_uk/tax_benefit_system.py +141 -0
  160. policyengine_uk/tests/behavioral_responses/test_labor_supply_responses.yaml +183 -0
  161. policyengine_uk/tests/microsimulation/reforms_config.yaml +8 -8
  162. policyengine_uk/tests/microsimulation/test_reform_impacts.py +2 -2
  163. policyengine_uk/tests/microsimulation/test_salary_sacrifice_cap_reform.py +401 -0
  164. policyengine_uk/tests/microsimulation/test_validity.py +2 -3
  165. policyengine_uk/tests/microsimulation/update_reform_impacts.py +104 -40
  166. policyengine_uk/tests/policy/baseline/contrib/policyengine/employer_ni/employer_ni_fixed_employer_cost_change.yaml +105 -0
  167. policyengine_uk/tests/policy/baseline/finance/benefit/family/child_benefit.yaml +2 -0
  168. policyengine_uk/tests/policy/baseline/finance/benefit/family/income_support.yaml +0 -23
  169. policyengine_uk/tests/policy/baseline/gov/dcms/bbc/tv-licence/tv_licence.yaml +3 -0
  170. policyengine_uk/tests/policy/baseline/gov/dfe/extended_childcare_entitlement/extended_childcare_entitlement.yaml +17 -17
  171. policyengine_uk/tests/policy/baseline/gov/dwp/basic_state_pension.yaml +44 -0
  172. policyengine_uk/tests/policy/baseline/gov/hmrc/income_tax/allowances/gift_aid.yaml +71 -0
  173. policyengine_uk/tests/policy/baseline/gov/hmrc/income_tax/allowances/personal_allowance.yaml +161 -0
  174. policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/salary_sacrifice_pension_ni_employee.yaml +107 -0
  175. policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/salary_sacrifice_pension_ni_employer.yaml +95 -0
  176. policyengine_uk/tests/policy/baseline/gov/hmrc/student_loans/student_loan_interest_rate.yaml +153 -0
  177. policyengine_uk/tests/policy/baseline/gov/hmrc/student_loans/student_loan_repayment.yaml +130 -0
  178. policyengine_uk/tests/policy/baseline/household/wealth/vehicle.yaml +27 -0
  179. policyengine_uk/tests/policy/reforms/nov_2025_budget/income_source_tax_rates.yaml +235 -0
  180. policyengine_uk/tests/policy/reforms/nov_2025_budget/income_tax_freeze.yaml +83 -0
  181. policyengine_uk/tests/policy/reforms/parametric/basic_income/basic_income.yaml +1 -0
  182. policyengine_uk/tests/test_behavioral_responses.py +215 -0
  183. policyengine_uk/tests/test_fiscal_year_parameters.py +131 -0
  184. policyengine_uk/utils/__init__.py +1 -0
  185. policyengine_uk/utils/compare.py +28 -0
  186. policyengine_uk/utils/create_ahc_deflator.py +169 -0
  187. policyengine_uk/utils/create_triple_lock.py +1 -1
  188. policyengine_uk/utils/dependencies.py +259 -0
  189. policyengine_uk/utils/parameters.py +12 -1
  190. policyengine_uk/utils/scenario.py +225 -0
  191. policyengine_uk/utils/solve_private_school_attendance_factor.py +4 -6
  192. policyengine_uk/variables/contrib/policyengine/education_budget_change.py +0 -1
  193. policyengine_uk/variables/contrib/policyengine/employer_ni/baseline_employer_cost.py +5 -1
  194. policyengine_uk/variables/contrib/policyengine/employer_ni/employer_ni_fixed_employer_cost_change.py +23 -23
  195. policyengine_uk/variables/contrib/policyengine/employer_ni/employer_ni_response_capital_incidence.py +1 -1
  196. policyengine_uk/variables/contrib/policyengine/employer_ni/employer_ni_response_consumer_incidence.py +1 -1
  197. policyengine_uk/variables/contrib/policyengine/other_public_spending_budget_change.py +0 -1
  198. policyengine_uk/variables/gov/dfe/targeted_childcare_entitlement/targeted_childcare_entitlement_eligible.py +0 -1
  199. policyengine_uk/variables/gov/dft/rail_subsidy_spending.py +16 -1
  200. policyengine_uk/variables/gov/dft/rail_usage.py +16 -0
  201. policyengine_uk/variables/gov/dwp/BRMA_LHA_rate.py +7 -2
  202. policyengine_uk/variables/gov/dwp/LHA_category.py +4 -2
  203. policyengine_uk/variables/gov/dwp/additional_state_pension.py +4 -2
  204. policyengine_uk/variables/gov/dwp/basic_state_pension.py +26 -8
  205. policyengine_uk/variables/gov/dwp/is_CTC_eligible.py +1 -1
  206. policyengine_uk/variables/gov/dwp/is_benefit_cap_exempt.py +9 -13
  207. policyengine_uk/variables/gov/dwp/is_benefit_cap_exempt_earnings.py +66 -0
  208. policyengine_uk/variables/gov/dwp/is_benefit_cap_exempt_health_disability.py +75 -0
  209. policyengine_uk/variables/gov/dwp/is_benefit_cap_exempt_other.py +66 -0
  210. policyengine_uk/variables/gov/dwp/winter_fuel_allowance.py +5 -4
  211. policyengine_uk/variables/gov/gov_tax.py +0 -2
  212. policyengine_uk/variables/gov/hmrc/household_tax.py +0 -1
  213. policyengine_uk/variables/gov/hmrc/income_tax/allowances/gift_aid.py +23 -0
  214. policyengine_uk/variables/gov/hmrc/income_tax/allowances/personal_allowance.py +9 -2
  215. policyengine_uk/variables/gov/hmrc/income_tax/income_tax_pre_charges.py +1 -0
  216. policyengine_uk/variables/gov/hmrc/income_tax/liability/property_income_tax.py +75 -0
  217. policyengine_uk/variables/gov/hmrc/income_tax/liability/savings_income_tax.py +4 -4
  218. policyengine_uk/variables/gov/hmrc/national_insurance/salary_sacrifice_broad_base_haircut.py +43 -0
  219. policyengine_uk/variables/gov/hmrc/national_insurance/salary_sacrifice_pension_ni_employee.py +38 -0
  220. policyengine_uk/variables/gov/hmrc/national_insurance/salary_sacrifice_pension_ni_employer.py +27 -0
  221. policyengine_uk/variables/gov/hmrc/pensions/pension_contributions_via_salary_sacrifice_adjusted.py +31 -0
  222. policyengine_uk/variables/gov/hmrc/pensions/salary_sacrifice_returned_to_income.py +41 -0
  223. policyengine_uk/variables/gov/hmrc/student_loans/__init__.py +2 -0
  224. policyengine_uk/variables/gov/hmrc/student_loans/plan_1_interest_rate.py +23 -0
  225. policyengine_uk/variables/gov/hmrc/student_loans/plan_2_interest_rate.py +31 -0
  226. policyengine_uk/variables/gov/hmrc/student_loans/plan_4_interest_rate.py +22 -0
  227. policyengine_uk/variables/gov/hmrc/student_loans/plan_5_interest_rate.py +18 -0
  228. policyengine_uk/variables/gov/hmrc/student_loans/postgraduate_interest_rate.py +23 -0
  229. policyengine_uk/variables/gov/hmrc/student_loans/student_loan_plan.py +27 -0
  230. policyengine_uk/variables/gov/hmrc/student_loans/student_loan_repayment.py +91 -0
  231. policyengine_uk/variables/gov/hmrc/student_loans/student_loan_repayment_rate.py +31 -0
  232. policyengine_uk/variables/gov/hmrc/would_claim_child_benefit.py +5 -1
  233. policyengine_uk/variables/household/demographic/benunit/benunit_count_adults.py +11 -0
  234. policyengine_uk/variables/household/demographic/is_disabled_for_benefits.py +13 -1
  235. policyengine_uk/variables/household/income/hbai_household_net_income.py +29 -1
  236. policyengine_uk/variables/household/income/hbai_household_net_income_ahc.py +13 -0
  237. policyengine_uk/variables/household/income/household_net_income.py +5 -1
  238. policyengine_uk/variables/household/income/inflation_adjustment.py +24 -0
  239. policyengine_uk/variables/household/post_tax_income.py +12 -0
  240. policyengine_uk/variables/household/wealth/num_vehicles.py +9 -0
  241. policyengine_uk/variables/household/wealth/owns_vehicle.py +17 -0
  242. policyengine_uk/variables/input/consumption/property/council_tax.py +0 -35
  243. policyengine_uk/variables/input/consumption/property/employee_pension_contributions.py +8 -1
  244. policyengine_uk/variables/input/consumption/property/employee_pension_contributions_reported.py +16 -0
  245. policyengine_uk/variables/input/consumption/property/pension_contributions_via_salary_sacrifice.py +16 -0
  246. policyengine_uk/variables/input/employment_income.py +2 -0
  247. policyengine_uk/variables/input/rent.py +0 -40
  248. policyengine_uk/variables/input/savings_interest_income.py +3 -1
  249. {policyengine_uk-2.40.1.dist-info → policyengine_uk-2.65.6.dist-info}/METADATA +17 -8
  250. {policyengine_uk-2.40.1.dist-info → policyengine_uk-2.65.6.dist-info}/RECORD +252 -173
  251. {policyengine_uk-2.40.1.dist-info → policyengine_uk-2.65.6.dist-info}/WHEEL +1 -1
  252. policyengine_uk/repo.py +0 -3
  253. policyengine_uk/tests/policy/baseline/gov/abolitions/abolition_parameters.yaml +0 -250
  254. policyengine_uk/variables/contrib/policyengine/high_income_incident_tax_change.py +0 -22
  255. policyengine_uk-2.40.1.data/data/share/openfisca/openfisca-country-template/CHANGELOG.md +0 -2285
  256. policyengine_uk-2.40.1.data/data/share/openfisca/openfisca-country-template/README.md +0 -37
  257. policyengine_uk-2.40.1.dist-info/licenses/LICENSE +0 -661
  258. {policyengine_uk-2.40.1.data/data/share/openfisca/openfisca-country-template → policyengine_uk-2.65.6.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1,38 @@
1
+ from policyengine_uk.model_api import *
2
+
3
+
4
+ class salary_sacrifice_pension_ni_employee(Variable):
5
+ label = "Employee NI on salary sacrifice pension contributions above cap"
6
+ documentation = (
7
+ "Additional employee National Insurance contributions due to "
8
+ "salary sacrifice pension contributions exceeding the cap. "
9
+ "The full excess is redirected to regular pension contributions "
10
+ "and subject to NI (but gets income tax relief)."
11
+ )
12
+ entity = Person
13
+ definition_period = YEAR
14
+ value_type = float
15
+ unit = GBP
16
+ reference = "https://policyengine.org/uk/research/uk-salary-sacrifice-cap"
17
+
18
+ def formula(person, period, parameters):
19
+ # Get the excess that's redirected to regular pension
20
+ # This is the amount subject to NI
21
+ excess = person("salary_sacrifice_returned_to_income", period)
22
+
23
+ # Use existing NI Class 1 parameters
24
+ ni_params = parameters(period).gov.hmrc.national_insurance.class_1
25
+ employment_income = person("employment_income", period)
26
+ upper_earnings_limit = (
27
+ ni_params.thresholds.upper_earnings_limit * WEEKS_IN_YEAR
28
+ )
29
+
30
+ # Apply appropriate NI rate based on income level
31
+ # Main rate (8%) for income <= UEL, additional rate (2%) for income > UEL
32
+ ni_rate = where(
33
+ employment_income <= upper_earnings_limit,
34
+ ni_params.rates.employee.main,
35
+ ni_params.rates.employee.additional,
36
+ )
37
+
38
+ return excess * ni_rate
@@ -0,0 +1,27 @@
1
+ from policyengine_uk.model_api import *
2
+
3
+
4
+ class salary_sacrifice_pension_ni_employer(Variable):
5
+ label = "Employer NI on salary sacrifice pension contributions above cap"
6
+ documentation = (
7
+ "Additional employer National Insurance contributions due to "
8
+ "salary sacrifice pension contributions exceeding the cap. "
9
+ "The full excess is redirected to regular pension contributions "
10
+ "and subject to employer NI."
11
+ )
12
+ entity = Person
13
+ definition_period = YEAR
14
+ value_type = float
15
+ unit = GBP
16
+ reference = "https://policyengine.org/uk/research/uk-salary-sacrifice-cap"
17
+
18
+ def formula(person, period, parameters):
19
+ # Get the excess that's redirected to regular pension
20
+ # This is the amount subject to employer NI
21
+ excess = person("salary_sacrifice_returned_to_income", period)
22
+
23
+ # Use existing NI Class 1 employer rate parameter
24
+ ni_params = parameters(period).gov.hmrc.national_insurance.class_1
25
+ employer_rate = ni_params.rates.employer
26
+
27
+ return excess * employer_rate
@@ -0,0 +1,31 @@
1
+ from policyengine_uk.model_api import *
2
+
3
+
4
+ class pension_contributions_via_salary_sacrifice_adjusted(Variable):
5
+ label = "Adjusted salary sacrifice pension contributions (capped)"
6
+ documentation = (
7
+ "The actual amount of salary sacrifice pension contributions after "
8
+ "applying the cap. Contributions above the cap are redirected to "
9
+ "regular employee pension contributions and subject to NI."
10
+ )
11
+ entity = Person
12
+ definition_period = YEAR
13
+ value_type = float
14
+ unit = GBP
15
+ reference = "https://policyengine.org/uk/research/salary-sacrifice-cap"
16
+
17
+ def formula(person, period, parameters):
18
+ intended_ss = person(
19
+ "pension_contributions_via_salary_sacrifice", period
20
+ )
21
+ cap = parameters(
22
+ period
23
+ ).gov.hmrc.national_insurance.salary_sacrifice_pension_cap
24
+
25
+ # If cap is infinite, no adjustment needed
26
+ if np.isinf(cap):
27
+ return intended_ss
28
+
29
+ # Cap the salary sacrifice at the limit
30
+ # Excess is redirected to regular pension contributions
31
+ return min_(intended_ss, cap)
@@ -0,0 +1,41 @@
1
+ from policyengine_uk.model_api import *
2
+
3
+
4
+ class salary_sacrifice_returned_to_income(Variable):
5
+ label = "Amount of salary sacrifice redirected to employee pension contributions"
6
+ documentation = (
7
+ "The amount of excess salary sacrifice (above the cap) that is redirected "
8
+ "to regular employee pension contributions. This maintains total pension savings "
9
+ "while subjecting the excess to National Insurance (but not income tax, since "
10
+ "regular pension contributions receive income tax relief). "
11
+ "\n\n"
12
+ "The full excess is redirected - the employer cost increase is handled via "
13
+ "the broad-base haircut (salary_sacrifice_broad_base_haircut) which reduces "
14
+ "ALL workers' employment income by ~0.16%, not just affected workers."
15
+ )
16
+ entity = Person
17
+ definition_period = YEAR
18
+ value_type = float
19
+ unit = GBP
20
+ reference = "https://policyengine.org/uk/research/uk-salary-sacrifice-cap"
21
+
22
+ def formula(person, period, parameters):
23
+ intended_ss = person(
24
+ "pension_contributions_via_salary_sacrifice", period
25
+ )
26
+ cap = parameters(
27
+ period
28
+ ).gov.hmrc.national_insurance.salary_sacrifice_pension_cap
29
+
30
+ # If cap is infinite, no excess to redirect
31
+ if np.isinf(cap):
32
+ return 0
33
+
34
+ # Calculate excess above cap - full excess is redirected to regular
35
+ # employee pension contributions (no targeted haircut on the individual)
36
+ excess = max_(intended_ss - cap, 0)
37
+
38
+ # Full excess is redirected to employment income (and then to employee
39
+ # pension contributions for income tax relief). The employer NI cost
40
+ # increase is spread across ALL workers via salary_sacrifice_broad_base_haircut.
41
+ return excess
@@ -0,0 +1,2 @@
1
+ from policyengine_uk.variables.gov.hmrc.student_loans.student_loan_plan import *
2
+ from policyengine_uk.variables.gov.hmrc.student_loans.student_loan_repayment import *
@@ -0,0 +1,23 @@
1
+ from policyengine_uk.model_api import *
2
+
3
+
4
+ class plan_1_interest_rate(Variable):
5
+ value_type = float
6
+ entity = Person
7
+ label = "Plan 1 student loan interest rate"
8
+ documentation = (
9
+ "Interest rate for Plan 1 student loans (pre-2012 England/Wales). "
10
+ "Set at the lower of RPI or Bank of England base rate + 1%. "
11
+ "Note: Actual rates are set annually in September using March RPI."
12
+ )
13
+ definition_period = YEAR
14
+ unit = "/1"
15
+ reference = "https://www.legislation.gov.uk/uksi/2009/470/regulation/21"
16
+
17
+ def formula(person, period, parameters):
18
+ p = parameters(period).gov
19
+ return min_(
20
+ p.economic_assumptions.yoy_growth.obr.rpi,
21
+ p.boe.base_rate
22
+ + p.hmrc.student_loans.interest_rates.plan_1.boe_margin,
23
+ )
@@ -0,0 +1,31 @@
1
+ from policyengine_uk.model_api import *
2
+ import numpy as np
3
+
4
+
5
+ class plan_2_interest_rate(Variable):
6
+ value_type = float
7
+ entity = Person
8
+ label = "Plan 2 student loan interest rate"
9
+ documentation = (
10
+ "Income-contingent interest rate for Plan 2 student loans. "
11
+ "RPI only below lower threshold, tapered to RPI+3% at upper threshold. "
12
+ "Note: Actual rates are set annually in September using March RPI."
13
+ )
14
+ definition_period = YEAR
15
+ unit = "/1"
16
+ reference = "https://www.legislation.gov.uk/uksi/2012/1309/regulation/10"
17
+
18
+ def formula(person, period, parameters):
19
+ income = person("adjusted_net_income", period)
20
+ p = parameters(period).gov.hmrc.student_loans
21
+ rpi = parameters(period).gov.economic_assumptions.yoy_growth.obr.rpi
22
+
23
+ # Per Regulation 21AB, lower interest threshold = repayment threshold
24
+ # Below lower: RPI only; above upper: RPI + 3%; between: linear taper
25
+ taper_fraction = np.clip(
26
+ (income - p.thresholds.plan_2)
27
+ / (p.interest_rates.plan_2.upper_threshold - p.thresholds.plan_2),
28
+ 0,
29
+ 1,
30
+ )
31
+ return rpi + p.interest_rates.plan_2.additional_rate * taper_fraction
@@ -0,0 +1,22 @@
1
+ from policyengine_uk.model_api import *
2
+
3
+
4
+ class plan_4_interest_rate(Variable):
5
+ value_type = float
6
+ entity = Person
7
+ label = "Plan 4 student loan interest rate"
8
+ documentation = (
9
+ "Interest rate for Plan 4 student loans (Scotland). "
10
+ "Set at the lower of RPI or Bank of England base rate + 1%. "
11
+ "Same calculation as Plan 1, defined via amendments to SI 2009/470."
12
+ )
13
+ definition_period = YEAR
14
+ unit = "/1"
15
+ reference = [
16
+ "https://www.legislation.gov.uk/uksi/2009/470/regulation/21",
17
+ "https://www.legislation.gov.uk/uksi/2022/1335", # Plan 4 amendments
18
+ ]
19
+
20
+ def formula(person, period, parameters):
21
+ # Plan 4 uses identical interest rate calculation as Plan 1
22
+ return person("plan_1_interest_rate", period)
@@ -0,0 +1,18 @@
1
+ from policyengine_uk.model_api import *
2
+
3
+
4
+ class plan_5_interest_rate(Variable):
5
+ value_type = float
6
+ entity = Person
7
+ label = "Plan 5 student loan interest rate"
8
+ documentation = (
9
+ "Interest rate for Plan 5 student loans (from September 2023). "
10
+ "Set at RPI only - no additional percentage based on income."
11
+ )
12
+ definition_period = YEAR
13
+ unit = "/1"
14
+ reference = "https://www.legislation.gov.uk/uksi/2023/207/made"
15
+
16
+ def formula(person, period, parameters):
17
+ p = parameters(period).gov
18
+ return p.economic_assumptions.yoy_growth.obr.rpi
@@ -0,0 +1,23 @@
1
+ from policyengine_uk.model_api import *
2
+
3
+
4
+ class postgraduate_interest_rate(Variable):
5
+ value_type = float
6
+ entity = Person
7
+ label = "Postgraduate loan interest rate"
8
+ documentation = (
9
+ "Interest rate for Postgraduate loans (Master's and Doctoral). "
10
+ "Per Regulation 21B: 'RPI plus 3%'. "
11
+ "Unlike Plan 2, this rate applies regardless of income."
12
+ )
13
+ definition_period = YEAR
14
+ unit = "/1"
15
+ reference = "https://www.legislation.gov.uk/uksi/2009/470/regulation/21B"
16
+
17
+ def formula(person, period, parameters):
18
+ p = parameters(period).gov
19
+ # Per Regulation 21B: "RPI plus 3%"
20
+ return (
21
+ p.economic_assumptions.yoy_growth.obr.rpi
22
+ + p.hmrc.student_loans.interest_rates.postgraduate_additional_rate
23
+ )
@@ -0,0 +1,27 @@
1
+ from policyengine_uk.model_api import *
2
+
3
+
4
+ class StudentLoanPlan(Enum):
5
+ NONE = "NONE"
6
+ PLAN_1 = "PLAN_1"
7
+ PLAN_2 = "PLAN_2"
8
+ PLAN_4 = "PLAN_4"
9
+ PLAN_5 = "PLAN_5"
10
+ POSTGRADUATE = "POSTGRADUATE"
11
+
12
+
13
+ class student_loan_plan(Variable):
14
+ value_type = Enum
15
+ possible_values = StudentLoanPlan
16
+ default_value = StudentLoanPlan.NONE
17
+ entity = Person
18
+ label = "Student loan plan type"
19
+ documentation = (
20
+ "The type of student loan plan the person is on. "
21
+ "Plan 1: Started before Sept 2012 (England/Wales) or any time (NI). "
22
+ "Plan 2: Started Sept 2012 - Aug 2023 (England/Wales). "
23
+ "Plan 4: Scotland. "
24
+ "Plan 5: Started Aug 2023 onwards (England). "
25
+ "Postgraduate: Master's or Doctoral loans."
26
+ )
27
+ definition_period = YEAR
@@ -0,0 +1,91 @@
1
+ from policyengine_uk.model_api import *
2
+ from policyengine_uk.variables.gov.hmrc.student_loans.student_loan_plan import (
3
+ StudentLoanPlan,
4
+ )
5
+
6
+
7
+ class student_loan_repayment(Variable):
8
+ value_type = float
9
+ entity = Person
10
+ label = "Student loan repayment (modelled)"
11
+ documentation = (
12
+ "Annual student loan repayment calculated from income and plan type. "
13
+ "Repayments are 9% of income above threshold for Plans 1/2/4/5, "
14
+ "and 6% for Postgraduate loans."
15
+ )
16
+ definition_period = YEAR
17
+ unit = GBP
18
+
19
+ def formula(person, period, parameters):
20
+ plan = person("student_loan_plan", period)
21
+ income = person("adjusted_net_income", period)
22
+ p = parameters(period).gov.hmrc.student_loans
23
+
24
+ # Get threshold based on plan type
25
+ threshold = select(
26
+ [
27
+ plan == StudentLoanPlan.PLAN_1,
28
+ plan == StudentLoanPlan.PLAN_2,
29
+ plan == StudentLoanPlan.PLAN_4,
30
+ plan == StudentLoanPlan.PLAN_5,
31
+ plan == StudentLoanPlan.POSTGRADUATE,
32
+ ],
33
+ [
34
+ p.thresholds.plan_1,
35
+ p.thresholds.plan_2,
36
+ p.thresholds.plan_4,
37
+ p.thresholds.plan_5,
38
+ p.thresholds.postgraduate,
39
+ ],
40
+ default=np.inf,
41
+ )
42
+
43
+ rate = person("student_loan_repayment_rate", period)
44
+ return rate * max_(0, income - threshold)
45
+
46
+
47
+ class has_student_loan(Variable):
48
+ value_type = bool
49
+ entity = Person
50
+ label = "Has student loan"
51
+ documentation = "Whether the person has a student loan."
52
+ definition_period = YEAR
53
+
54
+ def formula(person, period, parameters):
55
+ plan = person("student_loan_plan", period)
56
+ return plan != StudentLoanPlan.NONE
57
+
58
+
59
+ class student_loan_interest_rate(Variable):
60
+ value_type = float
61
+ entity = Person
62
+ label = "Student loan interest rate"
63
+ documentation = (
64
+ "Annual interest rate on student loan balance. "
65
+ "Plan 2 has income-contingent rates (RPI to RPI+3%). "
66
+ "Plans 1, 4, 5 and Postgraduate have fixed rates."
67
+ )
68
+ definition_period = YEAR
69
+ unit = "/1"
70
+
71
+ def formula(person, period, parameters):
72
+ plan = person("student_loan_plan", period)
73
+
74
+ # Select rate based on plan type
75
+ return select(
76
+ [
77
+ plan == StudentLoanPlan.PLAN_1,
78
+ plan == StudentLoanPlan.PLAN_2,
79
+ plan == StudentLoanPlan.PLAN_4,
80
+ plan == StudentLoanPlan.PLAN_5,
81
+ plan == StudentLoanPlan.POSTGRADUATE,
82
+ ],
83
+ [
84
+ person("plan_1_interest_rate", period),
85
+ person("plan_2_interest_rate", period),
86
+ person("plan_4_interest_rate", period),
87
+ person("plan_5_interest_rate", period),
88
+ person("postgraduate_interest_rate", period),
89
+ ],
90
+ default=0,
91
+ )
@@ -0,0 +1,31 @@
1
+ from policyengine_uk.model_api import *
2
+ from policyengine_uk.variables.gov.hmrc.student_loans.student_loan_plan import (
3
+ StudentLoanPlan,
4
+ )
5
+
6
+
7
+ class student_loan_repayment_rate(Variable):
8
+ value_type = float
9
+ entity = Person
10
+ label = "Student loan repayment rate"
11
+ documentation = (
12
+ "Percentage of income above threshold paid toward student loan. "
13
+ "9% for Plans 1/2/4/5, 6% for Postgraduate loans."
14
+ )
15
+ definition_period = YEAR
16
+ unit = "/1"
17
+ reference = "https://www.gov.uk/repaying-your-student-loan/what-you-pay"
18
+
19
+ def formula(person, period, parameters):
20
+ plan = person("student_loan_plan", period)
21
+ p = parameters(period).gov.hmrc.student_loans
22
+
23
+ return where(
24
+ plan == StudentLoanPlan.POSTGRADUATE,
25
+ p.postgraduate_repayment_rate,
26
+ where(
27
+ plan == StudentLoanPlan.NONE,
28
+ 0,
29
+ p.repayment_rate,
30
+ ),
31
+ )
@@ -11,8 +11,12 @@ class would_claim_child_benefit(Variable):
11
11
  value_type = bool
12
12
 
13
13
  def formula(benunit, period, parameters):
14
+ claims_all_entitled_benefits = benunit(
15
+ "claims_all_entitled_benefits", period
16
+ )
14
17
  takeup_rate = parameters(period).gov.hmrc.child_benefit.takeup
15
18
  overall_p = takeup_rate.overall
16
- return (random(benunit) < overall_p) * ~benunit(
19
+ random_takeup = (random(benunit) < overall_p) & ~benunit(
17
20
  "child_benefit_opts_out", period
18
21
  )
22
+ return claims_all_entitled_benefits | random_takeup
@@ -0,0 +1,11 @@
1
+ from policyengine_uk.model_api import *
2
+
3
+
4
+ class benunit_count_adults(Variable):
5
+ value_type = int
6
+ entity = BenUnit
7
+ label = "number of adults in the benefit unit"
8
+ definition_period = YEAR
9
+
10
+ def formula(benunit, period, parameters):
11
+ return add(benunit, period, ["is_adult"])
@@ -14,4 +14,16 @@ class is_disabled_for_benefits(Variable):
14
14
  "dla",
15
15
  "pip",
16
16
  ]
17
- return add(person, period, QUALIFYING_BENEFITS) > 0
17
+
18
+ p_claims_lcwra_if_on_pip_dla = 0.8
19
+ p_claims_lcwra_if_not_on_pip_dla = 0.13
20
+
21
+ random_seed = random(person)
22
+
23
+ on_qual_benefits = add(person, period, QUALIFYING_BENEFITS) > 0
24
+
25
+ return np.where(
26
+ on_qual_benefits,
27
+ random_seed < p_claims_lcwra_if_on_pip_dla,
28
+ random_seed < p_claims_lcwra_if_not_on_pip_dla,
29
+ )
@@ -21,11 +21,39 @@ class hbai_household_net_income(Variable):
21
21
  "private_pension_income",
22
22
  "private_transfer_income",
23
23
  "maintenance_income",
24
- "hbai_benefits",
25
24
  "free_school_meals",
26
25
  "free_school_fruit_veg",
27
26
  "free_school_milk",
28
27
  "free_tv_licence_value",
28
+ "child_benefit",
29
+ "esa_income",
30
+ "esa_contrib",
31
+ "housing_benefit",
32
+ "income_support",
33
+ "jsa_income",
34
+ "jsa_contrib",
35
+ "pension_credit",
36
+ "universal_credit",
37
+ "working_tax_credit",
38
+ "child_tax_credit",
39
+ "attendance_allowance",
40
+ "afcs",
41
+ "bsp",
42
+ "carers_allowance",
43
+ "dla",
44
+ "iidb",
45
+ "incapacity_benefit",
46
+ "pip",
47
+ "sda",
48
+ "state_pension",
49
+ "maternity_allowance",
50
+ "statutory_sick_pay",
51
+ "statutory_maternity_pay",
52
+ "ssmg",
53
+ "cost_of_living_support_payment",
54
+ "winter_fuel_allowance",
55
+ "tax_free_childcare",
56
+ "healthy_start_vouchers",
29
57
  # Reference for tax-free-childcare: https://assets.publishing.service.gov.uk/media/5e7b191886650c744175d08b/households-below-average-income-1994-1995-2018-2019.pdf
30
58
  ]
31
59
  subtracts = [
@@ -17,3 +17,16 @@ class hbai_household_net_income_ahc(Variable):
17
17
  "mortgage_interest_repayment",
18
18
  "structural_insurance_payments",
19
19
  ]
20
+
21
+
22
+ class real_hbai_household_net_income_ahc(Variable):
23
+ label = "real household net income after housing costs (HBAI definition)"
24
+ entity = Household
25
+ definition_period = YEAR
26
+ value_type = float
27
+ unit = GBP
28
+
29
+ def formula(household, period, parameters):
30
+ return household("hbai_household_net_income_ahc", period) * household(
31
+ "inflation_adjustment", period
32
+ )
@@ -16,10 +16,14 @@ class household_net_income(Variable):
16
16
  ]
17
17
  subtracts = [
18
18
  "household_tax",
19
+ "pension_contributions",
19
20
  ]
20
21
 
21
22
  def formula(household, period, parameters):
22
23
  market_income = household("household_market_income", period)
23
24
  benefits = household("household_benefits", period)
24
25
  tax = household("household_tax", period)
25
- return np.round(market_income + benefits - tax)
26
+ pension_contributions = add(
27
+ household, period, ["pension_contributions"]
28
+ )
29
+ return np.round(market_income + benefits - tax - pension_contributions)
@@ -19,3 +19,27 @@ class inflation_adjustment(Variable):
19
19
  current_period_cpi = cpi(period)
20
20
  now_cpi = cpi(datetime.datetime.now().strftime("%Y-01-01"))
21
21
  return now_cpi / current_period_cpi
22
+
23
+
24
+ class inflation_adjustment_ahc(Variable):
25
+ label = f"inflation multiplier to get {datetime.datetime.now().year} after housing costs prices"
26
+ entity = Household
27
+ definition_period = YEAR
28
+ value_type = float
29
+ unit = "/1"
30
+
31
+ def formula(household, period, parameters):
32
+ cpi = (
33
+ parameters.gov.economic_assumptions.indices.obr.consumer_price_index
34
+ )
35
+ cpi_ahc = (
36
+ parameters.gov.economic_assumptions.indices.obr.consumer_price_index_ahc
37
+ )
38
+
39
+ cpi_ahc_val = cpi_ahc(period)
40
+ # Fall back to use cpi, for periods beyond 2029
41
+ if not cpi_ahc_val:
42
+ cpi_ahc_val = cpi(period)
43
+
44
+ now_cpi_ahc = cpi(datetime.datetime.now().strftime("%Y-01-01"))
45
+ return now_cpi_ahc / cpi_ahc_val
@@ -0,0 +1,12 @@
1
+ from policyengine_uk.model_api import *
2
+
3
+
4
+ class post_tax_income(Variable):
5
+ label = "post-tax income"
6
+ documentation = "The income of a household after taxes have been deducted."
7
+ entity = Household
8
+ definition_period = YEAR
9
+ value_type = float
10
+ unit = GBP
11
+ adds = ["total_income"]
12
+ subtracts = ["income_tax", "national_insurance"]
@@ -0,0 +1,9 @@
1
+ from policyengine_uk.model_api import *
2
+
3
+
4
+ class num_vehicles(Variable):
5
+ label = "number of vehicles owned by the household"
6
+ documentation = "Imputed from WAS vcarnr7 variable"
7
+ entity = Household
8
+ definition_period = YEAR
9
+ value_type = int
@@ -0,0 +1,17 @@
1
+ from policyengine_uk.model_api import *
2
+
3
+
4
+ class owns_vehicle(Variable):
5
+ label = "whether the household owns a vehicle"
6
+ documentation = (
7
+ "Used for calibration to NTS 2024 data "
8
+ "showing 78% of UK households own at least one car. "
9
+ "Source: https://www.gov.uk/government/statistics/national-travel-survey-2024"
10
+ )
11
+ reference = "https://www.gov.uk/government/statistics/national-travel-survey-2024/nts-2024-household-car-availability-and-trends-in-car-trips"
12
+ entity = Household
13
+ definition_period = YEAR
14
+ value_type = bool
15
+
16
+ def formula(household, period):
17
+ return household("num_vehicles", period) > 0
@@ -9,38 +9,3 @@ class council_tax(Variable):
9
9
  definition_period = YEAR
10
10
  unit = GBP
11
11
  quantity_type = FLOW
12
-
13
- def formula(household, period, parameters):
14
- if period.start.year < 2023:
15
- # We don't have growth rates for council tax by nation before this.
16
- return 0
17
-
18
- if household.simulation.dataset is None:
19
- return 0
20
-
21
- data_year = household.simulation.dataset.time_period
22
-
23
- original_ct = household("council_tax", data_year)
24
-
25
- ct = parameters.gov.economic_assumptions.indices.obr.council_tax
26
-
27
- def get_growth(country):
28
- param = getattr(ct, country)
29
- return param(period.start.year) / param(data_year)
30
-
31
- country = household("country", period).decode_to_str()
32
-
33
- return select(
34
- [
35
- country == "ENGLAND",
36
- country == "WALES",
37
- country == "SCOTLAND",
38
- True,
39
- ],
40
- [
41
- original_ct * get_growth("england"),
42
- original_ct * get_growth("wales"),
43
- original_ct * get_growth("scotland"),
44
- original_ct,
45
- ],
46
- )