Skip to content
Open
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
1 change: 1 addition & 0 deletions changelog.d/spi-income-earnings-groups.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Draw SPI incomes for the enhanced FRS's SPI-synthetic rows within earnings groups (employee, self-employed, both, neither) set by each row's FRS employment status, so employees draw pay, the self-employed draw a trade, people out of work draw no earnings, and children keep their own (zero) incomes (#504). Calibrate to the ONS LFS counts of employees and the self-employed, and report rather than train on HMRC's local counts of taxpayers with employment income, which are annual and include part-year earners the FRS records as out of work.
13 changes: 11 additions & 2 deletions policyengine_uk_data/datasets/create_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@

logging.basicConfig(level=logging.INFO)

# Local targets the calibration logs but does not train on. HMRC's counts of
# income-tax payers with employment income by area (SPI table 3.15) are annual:
# they include people with pay for part of the year whose FRS status at
# interview is out of work, and who therefore have no pay in the FRS. Training
# on them moves weight from people out of work to employees, away from the LFS
# employee count (targets/sources/ons_labour_market.py). The area amounts of
# employment income, and the national counts by income band, still train.
VALIDATION_ONLY_LOCAL_TARGETS = ["hmrc/employment_income/count"]


def _get_positive_int_env(name: str, default: int) -> int:
raw_value = os.environ.get(name)
Expand Down Expand Up @@ -252,7 +261,7 @@ def main():
area_count=650,
weight_file="parliamentary_constituency_weights.h5",
dataset_key=str(frs_release.calibration_year),
excluded_training_targets=[],
excluded_training_targets=VALIDATION_ONLY_LOCAL_TARGETS,
log_csv="constituency_calibration_log.csv",
verbose=True, # Enable nested progress display
area_name="Constituency",
Expand All @@ -279,7 +288,7 @@ def main():
area_count=360,
weight_file="local_authority_weights.h5",
dataset_key=str(frs_release.calibration_year),
excluded_training_targets=[],
excluded_training_targets=VALIDATION_ONLY_LOCAL_TARGETS,
log_csv="la_calibration_log.csv",
verbose=True, # Enable nested progress display
area_name="Local Authority",
Expand Down
Loading
Loading