Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: patch
changes:
added:
- Calibration to benefit cap statistics.
19 changes: 19 additions & 0 deletions policyengine_uk_data/utils/loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,25 @@ def pe_count(*variables):
target_names.append(name)
target_values.append(float(row["Total"]) * uprating)

# Benefit cap counts

benefit_cap_reduction = sim.calculate(
"benefit_cap_reduction", map_to="household"
).values
df["dwp/benefit_capped_households"] = (benefit_cap_reduction > 0).astype(
float
)
target_names.append("dwp/benefit_capped_households")
target_values.append(
115_000
) # https://www.gov.uk/government/statistics/benefit-cap-number-of-households-capped-to-february-2025/benefit-cap-number-of-households-capped-to-february-2025

df["dwp/benefit_cap_total_reduction"] = benefit_cap_reduction.astype(float)
target_names.append("dwp/benefit_cap_total_reduction")
target_values.append(
60 * 52 * 115_000
) # same source as above, multiply avg cap amount by total capped population

combined_targets = pd.concat(
[
targets,
Expand Down