openfisca / openfisca-core

OpenFisca core engine. See other repositories for countries-specific code & data.
https://openfisca.org
GNU Affero General Public License v3.0
168 stars 75 forks source link

Scale-type phase-out parameter structure #1133

Open MaxGhenis opened 2 years ago

MaxGhenis commented 2 years ago

Governments often structure benefit programs and tax credits with a maximum value, a phase-out start, and a phase-out rate. For example, the US Supplemental Security Income program phases out with income at 50% above an exemption; from the OpenFisca US docs:

image

We model these with sets of parameters for maximum_amount, phase_out_start, and phase_out_rate (e.g. see the US Child Tax Credit), and then code structures like:

reduction = max_(0, income - phase_out_start) * phase_out_rate
return max_(0, maximum_amount - reduction)

I'd suggest a parameter structure that captures these elements and automatically computes the value via phase_out_parameter.calc(income), in the vein of parameter scales. I think this would reduce code duplication and room for error.

@nikhilwoodruff @rickecon