euromod.eu_euromod.calibrate.estimates¶
Estimates as files: the published baseline, and saving and loading your own.
A table of estimates, as returned by
calibrate_hsv(), has one row per system and
household type. save_estimates() writes such a table to a JSON file, together
with any notes on how it was made, and load_estimates() reads it back, so a
model can use estimates without running EUROMOD.
The package ships one such file: the estimates for the 27 EU member states and the
euro area, policy years 2022 to 2025. load_estimates() without a path returns them, and
schedule() turns a row of any table into a Schedule that computes
tax rates, taxes and disposable incomes.
Below are listed the main public classes of the euromod.eu_euromod.calibrate.estimates module.
|
Load a table of estimates. |
|
Save a table of estimates as a JSON file. |
|
The fitted tax-benefit function of one system and household type, ready to use. |
- class euromod.eu_euromod.calibrate.estimates.Schedule(lambda_, tau)¶
- A fitted tax-benefit function, ready to use.
Incomes are in multiples of mean gross income, as numbers or arrays: 1.0 is mean income. Multiply by the mean gross income of the population you apply it to for amounts in currency.
Example
>>> portugal = Schedule(0.1925, 0.1631) >>> portugal.net_tax_rate(2.0) # average rate at twice the mean income 0.2788 >>> portugal.net_taxes(2.0) # taxes net of benefits 0.5576 >>> portugal.disposable_income(2.0) 1.4424
Overview
Methods¶ disposable_income(income)Gross income minus net taxes.
marginal_rate(income)Share of an extra unit of gross income that does not reach disposable income.
net_tax_rate(income)Average net tax rate: taxes net of benefits, as a share of gross income.
net_taxes(income)Taxes net of benefits. Negative when benefits exceed taxes.
Methods
- disposable_income(income)¶
Gross income minus net taxes.
- marginal_rate(income)¶
Share of an extra unit of gross income that does not reach disposable income.
- net_tax_rate(income)¶
Average net tax rate: taxes net of benefits, as a share of gross income.
- net_taxes(income)¶
Taxes net of benefits. Negative when benefits exceed taxes.
Functions¶
- euromod.eu_euromod.calibrate.estimates.load_estimates(path=None)¶
Load a table of estimates.
- Parameters:
path (
str, optional) – A file written bysave_estimates(). Default: the estimates that ship with the package, by household type, for the 27 EU member states ("AT_2022", …,"SK_2025") and the euro area ("EA_2022", …,"EA_2025": 19 members in 2022, 20 from 2023), policy years 2022 to 2025.- Returns:
Indexed by system and household type, with the columns of
fit_hsv()andfit_diagnostics(). The notes saved with the estimates are in.attrs.- Return type:
Example
>>> baseline = load_estimates() >>> baseline.loc[("PT_2022", "all"), ["lambda", "tau"]] lambda 0.1925 tau 0.1631 >>> baseline.attrs["model"] 'EUROMOD_RELEASES_J2.0+'
- euromod.eu_euromod.calibrate.estimates.save_estimates(estimates, path, **info)¶
Save a table of estimates as a JSON file.
- Parameters:
estimates (pandas.DataFrame) – Estimates indexed by system and household type, as returned by
calibrate_hsv().path (
str) – File to write.**info – What should be remembered about the estimates: anything that JSON can hold, e.g.
model="J2.0+",constants={"$tin00_rate9": 0.58},note="top income-tax rates raised by 10 points".
Example
>>> estimates = calibrate_hsv(MODEL, DATA, ["PT_2022"], constants=reform) >>> save_estimates(estimates, "pt_reform.json", constants=reform)
- euromod.eu_euromod.calibrate.estimates.schedule(estimates, system, household_type='all')¶
The fitted tax-benefit function of one system and household type, ready to use.
- Parameters:
estimates (pandas.DataFrame) – A table of estimates, from
load_estimates()orcalibrate_hsv().system (
str) – A system in the table, e.g."PT_2022"or"EA_2025".household_type (
str) – A household type in the table; default all households.
- Returns:
Computes the net tax rate, net taxes, disposable income and the marginal rate at any gross income. Calling it gives the net tax rate.
- Return type:
Example
>>> portugal = schedule(load_estimates(), "PT_2022") >>> portugal.net_tax_rate([0.5, 1.0, 2.0]) array([0.0958, 0.1925, 0.2788]) >>> portugal.disposable_income(2.0) 1.4424