Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c6ef3a4
refactor: update parameters
lars-reimann Nov 17, 2023
d9fb7bd
refactor: rename `arbeitsl_geld_2_m_hh`
lars-reimann Nov 17, 2023
228d3b0
refactor: rename `arbeitsl_geld_2_regelbedarf_m_bg_hh`
lars-reimann Nov 17, 2023
89baf2a
refactor: rename `_arbeitsl_geld_2_alleinerz_mehrbedarf_m_hh`
lars-reimann Nov 17, 2023
d992d4b
refactor: rename `arbeitsl_geld_2_kindersatz_m_hh`
lars-reimann Nov 17, 2023
836ae4c
refactor: rename `arbeitsl_geld_2_regelsatz_m_hh`
lars-reimann Nov 17, 2023
7db92d8
refactor: rename `arbeitsl_geld_2_vor_vorrang_m_hh`
lars-reimann Nov 17, 2023
9752bdc
refactor: rename `arbeitsl_geld_2_kost_unterk_m_hh`
lars-reimann Nov 17, 2023
684f38f
refactor: rename `_arbeitsl_geld_2_warmmiete_pro_qm_m_hh`
lars-reimann Nov 17, 2023
328c22f
refactor: rename `_arbeitsl_geld_2_berechtigte_wohnfläche_hh`
lars-reimann Nov 17, 2023
5e23504
refactor: rename `wohngeld_vorrang_hh`
lars-reimann Nov 17, 2023
ebc51ea
refactor: rename `wohngeld_kinderzuschl_vorrang_hh`
lars-reimann Nov 17, 2023
9350014
refactor: rename `kinderzuschl_vorrang_hh`
lars-reimann Nov 17, 2023
0e318ab
refactor: rename `kinderzuschl_vermög_freib_hh`
lars-reimann Nov 17, 2023
7c59aee
refactor: rename `wohngeld_nach_vermög_check_m_hh`
lars-reimann Nov 17, 2023
9b32a98
refactor: rename `arbeitsl_geld_2_vermög_freib_hh`
lars-reimann Nov 17, 2023
70ced69
refactor: rename `_arbeitsl_geld_2_vermög_freib_karenzz_hh`
lars-reimann Nov 17, 2023
d9f7826
refactor: rename `kinderzuschl_m_hh`
lars-reimann Nov 17, 2023
363b4bb
refactor: rename `grunds_im_alter_m_hh`
lars-reimann Nov 17, 2023
243a3ca
refactor: rename `grunds_im_alter_vermög_freib_hh`
lars-reimann Nov 17, 2023
af24e0b
refactor: rename `wohngeld_m_hh`
lars-reimann Nov 17, 2023
09e41fa
refactor: rename `wohngeld_eink_m_hh`
lars-reimann Nov 17, 2023
6b56647
refactor: rename `wohngeld_min_miete_m_vg`
lars-reimann Nov 17, 2023
f170c8b
refactor: rename `wohngeld_miete_m_hh`
lars-reimann Nov 17, 2023
f42b446
refactor: rename `wohngeld_vor_vermög_check_m_hh`
lars-reimann Nov 17, 2023
88e91bb
test: fix failing tests
lars-reimann Nov 17, 2023
dbc139f
docs: update changelog
lars-reimann Nov 17, 2023
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 CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ releases are available on [Anaconda.org](https://anaconda.org/conda-forge/gettsi

## Unpublished

- {gh}`662` Replace `hh` in function names by `bg`/`fg`/`vg` ({ghuser}`lars-reimann`).
- {gh}`659` Add rounding to Unterhaltsvorschuss, ESt, Wohngeld, Kinderzuschlag.
({ghuser}`MImmesberger`).
- {gh}`655` Correct calculation of Lohnsteuer for 2015 to 2023 ({ghuser}`JakobWegmann`).
Expand Down
8 changes: 4 additions & 4 deletions docs/geps/gep-01.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ a nutshell and without explanations, these conventions are:
Internal variables should be used sparingly.

1. If names need to be concatenated for making clear what a column name refers to (e.g.,
`arbeitsl_geld_2_vermög_freib_hh` vs. `grunds_im_alter_vermög_freib_hh`), the group
`arbeitsl_geld_2_vermög_freib_bg` vs. `grunds_im_alter_vermög_freib_vg`), the group
(i.e., the tax or transfer) that a variable refers to appears first.

1. Because of the necessity of concatenated column names, there will be conflicts
Expand Down Expand Up @@ -112,7 +112,7 @@ changed, even if it leads to long variable names (e.g., `kinderfreib`,
less error-prone.

If names need to be concatenated for making clear what a column name refers to (e.g.,
`arbeitsl_geld_2_vermög_freib_hh` vs. `grunds_im_alter_vermög_freib_hh`), the group
`arbeitsl_geld_2_vermög_freib_bg` vs. `grunds_im_alter_vermög_freib_vg`), the group
(i.e., the tax or transfer) that a variable refers to appears first.

If a column has a reference to a time unit (i.e., any flow variable like earnings or
Expand All @@ -123,7 +123,7 @@ the relevant unit, an underscore plus one of {`hh`, `tu`} will indicate the leve
aggregation.

Time unit identifiers always appear before unit identifiers (e.g.,
`arbeitsl_geld_2_m_hh`).
`arbeitsl_geld_2_m_bg`).

## Parameters of the taxes and transfers system

Expand All @@ -136,7 +136,7 @@ general naming considerations here.
- Parameter names should be generally be aligned with relevant column names. However,
since the group is not repeated for the parameter, it is often better not to
abbreviate them (e.g., `wohngeld_params["vermögensgrundfreibetrag"]` for the parameter
and `wohngeld_nach_vermög_check_m_hh` for a column derived from it).
and `wohngeld_nach_vermög_check_m_vg` for a column derived from it).

## Other Python identifiers (Functions, Variables)

Expand Down
6 changes: 3 additions & 3 deletions docs/geps/gep-04.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,16 +250,16 @@ Using a different reduction function than the sum is as easy as explicitly speci
`my_col_hh`.

Consider the following example: the function `kindergeld_m` calculates the
individual-level child benefit payment. `arbeitsl_geld_2_m_hh` calculates
individual-level child benefit payment. `arbeitsl_geld_2_m_bg` calculates
Arbeitslosengeld 2 on the household level (as indicated by the suffix). One necessary
input of this function is the sum of all child benefits on the household level. There is
no function or input column `kindergeld_m_hh`.

By including `kindergeld_m_hh` as an argument in the definition of
`arbeitsl_geld_2_m_hh` as follows:
`arbeitsl_geld_2_m_bg` as follows:

```python
def arbeitsl_geld_2_m_hh(kindergeld_m_hh, other_arguments):
def arbeitsl_geld_2_m_bg(kindergeld_m_hh, other_arguments):
...
```

Expand Down
8 changes: 4 additions & 4 deletions docs/gettsim_objects/variables_out.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ You can find their individual calculation in the documentation of all {ref}`func
- Solidarity surcharge on withholding tax
* - {func}`unterhaltsvors_m <_gettsim.functions.unterhaltsvors_m>`
- Alimony advance payment
* - {func}`arbeitsl_geld_2_m_hh <_gettsim.functions.arbeitsl_geld_2_m_hh>`
* - {func}`arbeitsl_geld_2_m_bg <_gettsim.functions.arbeitsl_geld_2_m_bg>`
- Monthly subsistence payment on household level
* - {func}`kinderzuschl_m_hh <_gettsim.functions.kinderzuschl_m_hh>`
* - {func}`kinderzuschl_m_bg <_gettsim.functions.kinderzuschl_m_bg>`
- Monthly additional child benefit, household sum
* - {func}`elterngeld_m <_gettsim.functions.elterngeld_m>`
- Monthly parental leave benefit
* - {func}`wohngeld_m_hh <_gettsim.functions.wohngeld_m_hh>`
* - {func}`wohngeld_m_vg <_gettsim.functions.wohngeld_m_vg>`
- Monthly housing benefit on household level
* - {func}`grunds_im_alter_m_hh <_gettsim.functions.grunds_im_alter_m_hh>`
* - {func}`grunds_im_alter_m_vg <_gettsim.functions.grunds_im_alter_m_vg>`
- Monthly subsistence payment for retirees on household level
```
58 changes: 29 additions & 29 deletions docs/tutorials/policy_functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,22 @@
"metadata": {},
"outputs": [],
"source": [
"def arbeitsl_geld_2_m_hh(\n",
" arbeitsl_geld_2_vor_vorrang_m_hh,\n",
" # wohngeld_vorrang_hh,\n",
" # kinderzuschl_vorrang_hh,\n",
" # wohngeld_kinderzuschl_vorrang_hh,\n",
"def arbeitsl_geld_2_m_bg(\n",
" arbeitsl_geld_2_vor_vorrang_m_bg,\n",
" # wohngeld_vorrang_vg,\n",
" # kinderzuschl_vorrang_bg,\n",
" # wohngeld_kinderzuschl_vorrang_vg,\n",
" erwachsene_alle_rentner_hh,\n",
"):\n",
" if (\n",
" # wohngeld_vorrang_hh\n",
" # | kinderzuschl_vorrang_hh\n",
" # | wohngeld_kinderzuschl_vorrang_hh\n",
" # wohngeld_vorrang_vg\n",
" # | kinderzuschl_vorrang_bg\n",
" # | wohngeld_kinderzuschl_vorrang_vg\n",
" erwachsene_alle_rentner_hh\n",
" ):\n",
" out = 0.0\n",
" else:\n",
" out = arbeitsl_geld_2_vor_vorrang_m_hh\n",
" out = arbeitsl_geld_2_vor_vorrang_m_bg\n",
"\n",
" return out"
]
Expand All @@ -113,7 +113,7 @@
"outputs": [],
"source": [
"policy_functions_no_check = copy.deepcopy(policy_functions)\n",
"policy_functions_no_check[\"arbeitsl_geld_2_m_hh\"] = arbeitsl_geld_2_m_hh"
"policy_functions_no_check[\"arbeitsl_geld_2_m_bg\"] = arbeitsl_geld_2_m_bg"
]
},
{
Expand Down Expand Up @@ -162,9 +162,9 @@
"source": [
"For this data we can now compare the results of using GETTSIM with the `policy_functions_no_check` and the usual `policy_functions`. \n",
"\n",
"We should expect to see positive values for `wohngeld_m_hh`, `kinderzuschl_m_hh` and `arbeitsl_geld_2_m_hh` at the same time if we do not check which combination of transfers is optimal (`policy_functions_no_check`).\n",
"We should expect to see positive values for `wohngeld_m_vg`, `kinderzuschl_m_bg` and `arbeitsl_geld_2_m_bg` at the same time if we do not check which combination of transfers is optimal (`policy_functions_no_check`).\n",
"\n",
"On the other hand, if we use the default version of the `policy_functions`, `wohngeld_m_hh` and `kinderzuschl_m_hh` should be zero as long as `arbeitsl_geld_2_m_hh` is positive (and the other way around), as it is a characteristic of the German taxes and transfers system that *Wohngeld* and *Kinderzuschlag* cannot be received in combination with *Arbeitslosengeld 2*."
"On the other hand, if we use the default version of the `policy_functions`, `wohngeld_m_vg` and `kinderzuschl_m_bg` should be zero as long as `arbeitsl_geld_2_m_bg` is positive (and the other way around), as it is a characteristic of the German taxes and transfers system that *Wohngeld* and *Kinderzuschlag* cannot be received in combination with *Arbeitslosengeld 2*."
]
},
{
Expand All @@ -173,7 +173,7 @@
"metadata": {},
"outputs": [],
"source": [
"targets = [\"wohngeld_m_hh\", \"kinderzuschl_m_hh\", \"arbeitsl_geld_2_m_hh\"]"
"targets = [\"wohngeld_m_vg\", \"kinderzuschl_m_bg\", \"arbeitsl_geld_2_m_bg\"]"
]
},
{
Expand Down Expand Up @@ -231,7 +231,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"On first glance, both figures look quite confusing because of the complexity of the German taxes and transfers system. But if we take a closer look, the figures confirm our expectations. If we let GETTSIM check for the most favorable combination of transfers, ```wohngeld_m_hh``` and ```kinderzuschl_m_hh``` are zero as long as `arbeitsl_geld_2_m_hh` is positive (i.e. the best option for the household) and the other way around. \n",
"On first glance, both figures look quite confusing because of the complexity of the German taxes and transfers system. But if we take a closer look, the figures confirm our expectations. If we let GETTSIM check for the most favorable combination of transfers, ```wohngeld_m_vg``` and ```kinderzuschl_m_bg``` are zero as long as `arbeitsl_geld_2_m_bg` is positive (i.e. the best option for the household) and the other way around. \n",
"\n",
"If we do not let GETTSIM do this check, this does not hold any longer and all transfers can be positive at the same time (which is what we were trying to achieve). \n",
"\n",
Expand All @@ -249,11 +249,11 @@
"result_no_check_p = compute_taxes_and_transfers(\n",
" data=data,\n",
" params=policy_params,\n",
" functions=[policy_functions, arbeitsl_geld_2_m_hh],\n",
" functions=[policy_functions, arbeitsl_geld_2_m_bg],\n",
" targets=[\n",
" \"wohngeld_m_hh\",\n",
" \"kinderzuschl_m_hh\",\n",
" \"arbeitsl_geld_2_m_hh\",\n",
" \"wohngeld_m_vg\",\n",
" \"kinderzuschl_m_bg\",\n",
" \"arbeitsl_geld_2_m_bg\",\n",
" ],\n",
")"
]
Expand All @@ -266,11 +266,11 @@
"\n",
"There are three important points:\n",
"\n",
"1. Note that ```arbeitsl_geld_2_m_hh``` has the same function name as a pre-defined function inside GETTSIM. Thus, the internal function will be replaced with this version.\n",
"1. Note that ```arbeitsl_geld_2_m_bg``` has the same function name as a pre-defined function inside GETTSIM. Thus, the internal function will be replaced with this version.\n",
"\n",
"2. In general, if there are multiple functions with the same name, internal functions have the lowest precedence. After that, the elements in the list passed to the ```functions``` argument are evaluated element by element. The functions in the leftmost element have the lowest precedence and the functions in the rightmost element have the highest.\n",
"\n",
"3. If ```policy_functions``` would not be necessary for this example, you can also directly pass the ```arbeitsl_geld_2_m_hh``` function to the ```functions``` argument.\n",
"3. If ```policy_functions``` would not be necessary for this example, you can also directly pass the ```arbeitsl_geld_2_m_bg``` function to the ```functions``` argument.\n",
"\n",
"### Multiple Functions\n",
"\n",
Expand All @@ -283,7 +283,7 @@
"metadata": {},
"outputs": [],
"source": [
"def kinderzuschl_m_hh(\n",
"def kinderzuschl_m_bg(\n",
" kindergeld_anspruch, kumulativer_kindergeld_anspruch_tu, kindergeld_params\n",
"):\n",
" \"\"\"Calculate the preliminary kindergeld.\n",
Expand Down Expand Up @@ -317,7 +317,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"If you edit ```arbeitsl_geld_2_m_hh``` and ```kinderzuschl_m_hh```, your two options to make GETTSIM incorporate your changes would be:\n",
"If you edit ```arbeitsl_geld_2_m_bg``` and ```kinderzuschl_m_bg```, your two options to make GETTSIM incorporate your changes would be:\n",
"\n",
"**Alternative 1:**"
]
Expand All @@ -329,8 +329,8 @@
"outputs": [],
"source": [
"policy_functions_reformed = copy.deepcopy(policy_functions)\n",
"policy_functions_reformed[\"arbeitsl_geld_2_m_hh\"] = arbeitsl_geld_2_m_hh\n",
"policy_functions_reformed[\"kinderzuschl_m_hh\"] = kinderzuschl_m_hh"
"policy_functions_reformed[\"arbeitsl_geld_2_m_bg\"] = arbeitsl_geld_2_m_bg\n",
"policy_functions_reformed[\"kinderzuschl_m_bg\"] = kinderzuschl_m_bg"
]
},
{
Expand All @@ -349,12 +349,12 @@
"df = compute_taxes_and_transfers(\n",
" data=data,\n",
" params=policy_params,\n",
" functions=[policy_functions, arbeitsl_geld_2_m_hh, kinderzuschl_m_hh],\n",
" functions=[policy_functions, arbeitsl_geld_2_m_bg, kinderzuschl_m_bg],\n",
" targets=[\n",
" \"wohngeld_m_hh\",\n",
" \"kinderzuschl_m_hh\",\n",
" \"arbeitsl_geld_2_m_hh\",\n",
" \"kinderzuschl_m_hh\",\n",
" \"wohngeld_m_vg\",\n",
" \"kinderzuschl_m_bg\",\n",
" \"arbeitsl_geld_2_m_bg\",\n",
" \"kinderzuschl_m_bg\",\n",
" ],\n",
")"
]
Expand Down
8 changes: 4 additions & 4 deletions src/_gettsim/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ def set_array_backend(backend: str):
"ges_pflegev_beitr_m",
"arbeitsl_geld_m",
"kindergeld_m_tu",
"arbeitsl_geld_2_m_hh",
"kinderzuschl_m_hh",
"wohngeld_m_hh",
"arbeitsl_geld_2_m_bg",
"kinderzuschl_m_bg",
"wohngeld_m_vg",
"unterhaltsvors_m_hh",
"grunds_im_alter_m_hh",
"grunds_im_alter_m_vg",
"ges_rente_m",
]

Expand Down
19 changes: 1 addition & 18 deletions src/_gettsim/parameters/wohngeld.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -475,23 +475,6 @@ koeffizienten_berechnungsformel:
a: -0.12
b: 0.0001152
c: 0.0000251
haushaltsgröße_hhn:
name:
de: Haushaltsgrößen, die beim Wohngeld berücksichtigt werden
en: Household sizes taken into account for housing benefit
description:
de: >-
Haushalte mit mehr als 5 Mitgliedern haben einen festgesetzten Höchstbetrag für
Miete und Belastung. Das Wohngeld für bis zu 12 Haushaltsmitglieder kann durch die
Formel berechnet werden.
en: >-
Households with more than 5 members have a fixed maximum amount for rent and
burden. The housing benefit for up to 12 household members can be calculated using
the formula be calculated.
reference: § 19 Abs.1 WoGG
1984-01-01:
1: 5
2: 12
bonus_sehr_große_haushalte:
name:
de: Zusätzlicher Betrag für große Haushalte
Expand Down Expand Up @@ -1987,7 +1970,7 @@ klimakomponente_m:
5: 39.20
jede_weitere_person: 4.8
rounding:
wohngeld_vor_vermög_check_m_hh:
wohngeld_vor_vermög_check_m_vg:
1970-01-01:
base: 1
direction: nearest
Expand Down
Loading