Skip to content

Commit ee54587

Browse files
baogorekclaude
andcommitted
Use income_tax_positive for CBO calibration in loss.py
The CBO income_tax parameter represents positive-only receipts (refundable credit payments in excess of liability are classified as outlays, not negative receipts). Using income_tax_positive matches this definition. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 0ef90b5 commit ee54587

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

policyengine_us_data/utils/loss.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,26 +220,35 @@ def build_loss_matrix(dataset: type, time_period):
220220
targets_array.append(populations[year])
221221

222222
# CBO projections
223+
# Note: income_tax_positive matches CBO's receipts definition where
224+
# refundable credit payments in excess of liability are classified as
225+
# outlays, not negative receipts. See: https://www.cbo.gov/publication/43767
223226

224-
PROGRAMS = [
225-
"income_tax",
227+
CBO_PROGRAMS = [
228+
"income_tax_positive",
226229
"snap",
227230
"social_security",
228231
"ssi",
229232
"unemployment_compensation",
230233
]
231234

232-
for variable_name in PROGRAMS:
235+
# Mapping from variable name to CBO parameter name (when different)
236+
CBO_PARAM_NAME_MAP = {
237+
"income_tax_positive": "income_tax",
238+
}
239+
240+
for variable_name in CBO_PROGRAMS:
233241
label = f"nation/cbo/{variable_name}"
234242
loss_matrix[label] = sim.calculate(
235243
variable_name, map_to="household"
236244
).values
237245
if any(loss_matrix[label].isna()):
238246
raise ValueError(f"Missing values for {label}")
247+
param_name = CBO_PARAM_NAME_MAP.get(variable_name, variable_name)
239248
targets_array.append(
240249
sim.tax_benefit_system.parameters(
241250
time_period
242-
).calibration.gov.cbo._children[variable_name]
251+
).calibration.gov.cbo._children[param_name]
243252
)
244253

245254
# 1. Medicaid Spending

0 commit comments

Comments
 (0)