Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 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
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def höchstbetrag_m(...) -> float: ...
- `_hh` (Haushalt - household)
- `_fg` (Familiengemeinschaft)
- `_bg` (Bedarfsgemeinschaft)
- `_eg` (Einstandsgemeinschaft)
- `_eg` (Einsatzgemeinschaft)
- `_ehe` (Ehegemeinschaft)

Example: `arbeitslosengeld_2__betrag_m_bg` = monthly ALG2 amount at Bedarfsgemeinschaft
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ All releases are available on [Anaconda.org](https://anaconda.org/conda-forge/ge

## Unreleased

- {gh}`1159` Add Einsatzgemeinschaft (SGB XII); remove Einstandsgemeinschaft.
({ghuser}`MImmesberger`)
- {gh}`1154` Fix Freibetrag for pension income from all pillars for Grundsicherung im
Alter. ({ghuser}`MImmesberger`)
- {gh}`1155` Fix Vermögensfreibetrag for Grundsicherung im Alter.
Expand Down
20 changes: 10 additions & 10 deletions docs/geps/gep-01.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ GETTSIM knows about the following units:
unit is based on the priority check via
`vorrangprüfungen__wohngeld_vorrang_vor_arbeitslosengeld_2_bg` and
`vorrangprüfungen__wohngeld_und_kinderzuschlag_vorrang_vor_arbeitslosengeld_2_bg`.
- `arbeitslosengeld_2__fg_id`: Familiengemeinschaft. Maximum of two generations, the
relevant unit for Bürgergeld / Arbeitslosengeld 2. Another way to think about this is
the potential Bedarfsgemeinschaft before making checks for whether children have
enough income fend for themselves. Subset of `hh`.
- `arbeitslosengeld_2__bg_id`: Bedarfsgemeinschaft, i.e., Familiengemeinschaft excluding
children who have enough income to fend for themselves (they will form separate
`bg`s). Subset of `arbeitslosengeld_2__fg_id`.
- `arbeitslosengeld_2__eg_id`: Einstandsgemeinschaft, a couple whose members are deemed
to be responsible for each other. This includes couples that live together and may or
may not be married or in a civil union.
- `arbeitslosengeld_2__fg_id` and `bürgergeld__fg_id`: Familiengemeinschaft. Maximum of
two generations, the relevant unit for Bürgergeld / Arbeitslosengeld 2. Another way to
think about this is the potential Bedarfsgemeinschaft before making checks for whether
children have enough income fend for themselves. Subset of `hh`.
- `arbeitslosengeld_2__bg_id` and `bürgergeld__bg_id`: Bedarfsgemeinschaft, i.e.,
Familiengemeinschaft excluding children who have enough income to fend for themselves
(they will form separate `bg`s). Subset of `arbeitslosengeld_2__fg_id` /
`bürgergeld__fg_id`.
- `grundsicherung__eg_id`: Einsatzgemeinschaft according to § 27 Abs. 2 SGB XII. Maximum
of two generations, the relevant unit for Grundsicherung im Alter / Sozialhilfe.
- `familie__ehe_id`: Ehegemeinschaft, i.e. couples that are married or in a civil union.
- `einkommensteuer__sn_id`: Steuernummer (same for spouses filing taxes jointly, not the
same as the Germany-wide Steuer-ID)
Expand Down
33 changes: 1 addition & 32 deletions docs/how_to_guides/calculating_elterngeld.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -278,38 +278,7 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"input_data_after_birth = {\n",
" \"alter\": np.array([31, 0]),\n",
" \"alter_monate\": np.array([372, 0]),\n",
" \"arbeitsstunden_w\": np.array([0, 0]),\n",
" \"bürgergeld\": {\"p_id_einstandspartner\": np.array([-1, -1])},\n",
" \"einnahmen\": {\"bruttolohn_m\": np.array([0, 0])},\n",
" \"elterngeld\": {\n",
" \"bisherige_bezugsmonate\": np.array([0, 0]),\n",
" \"claimed\": np.array([True, False]),\n",
" \"mean_nettoeinkommen_in_12_monaten_vor_geburt_m\": np.append(\n",
" net_wage_12_months_before_birth, np.array([0])\n",
" ),\n",
" \"zu_versteuerndes_einkommen_vorjahr_y_sn\": np.append(\n",
" taxable_income_2023, np.array([0])\n",
" ),\n",
" },\n",
" \"familie\": {\n",
" \"alleinerziehend\": np.array([True, False]),\n",
" \"p_id_elternteil_1\": np.array([-1, 0]),\n",
" \"p_id_elternteil_2\": np.array([-1, -1]),\n",
" },\n",
" \"hh_id\": np.array([0, 0]),\n",
" \"kindergeld\": {\"in_ausbildung\": np.array([False, False])},\n",
" \"lohnsteuer\": {\"steuerklasse\": np.array([1, 1])},\n",
" \"p_id\": np.array([0, 1]),\n",
" \"sozialversicherung\": {\n",
" \"pflege\": {\"beitrag\": {\"hat_kinder\": np.array([True, False])}}\n",
" },\n",
" \"wohnort_ost_hh\": np.array([False, False]),\n",
"}"
]
"source": "input_data_after_birth = {\n \"alter\": np.array([31, 0]),\n \"alter_monate\": np.array([372, 0]),\n \"arbeitsstunden_w\": np.array([0, 0]),\n \"einnahmen\": {\"bruttolohn_m\": np.array([0, 0])},\n \"elterngeld\": {\n \"bisherige_bezugsmonate\": np.array([0, 0]),\n \"claimed\": np.array([True, False]),\n \"mean_nettoeinkommen_in_12_monaten_vor_geburt_m\": np.append(\n net_wage_12_months_before_birth, np.array([0])\n ),\n \"zu_versteuerndes_einkommen_vorjahr_y_sn\": np.append(\n taxable_income_2023, np.array([0])\n ),\n },\n \"familie\": {\n \"alleinerziehend\": np.array([True, False]),\n \"p_id_lebenspartner\": np.array([-1, -1]),\n \"p_id_elternteil_1\": np.array([-1, 0]),\n \"p_id_elternteil_2\": np.array([-1, -1]),\n },\n \"hh_id\": np.array([0, 0]),\n \"kindergeld\": {\"in_ausbildung\": np.array([False, False])},\n \"lohnsteuer\": {\"steuerklasse\": np.array([1, 1])},\n \"p_id\": np.array([0, 1]),\n \"sozialversicherung\": {\n \"pflege\": {\"beitrag\": {\"hat_kinder\": np.array([True, False])}}\n },\n \"wohnort_ost_hh\": np.array([False, False]),\n}"
},
{
"cell_type": "markdown",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,12 @@
" },\n",
" \"gemeinsam_veranlagt\": np.array([True, True, False]),\n",
" },\n",
" \"bürgergeld\": {\n",
" \"p_id_einstandspartner\": np.array([1, 0, -1])\n",
" }, # not required for ESt, but we need it later\n",
" \"familie\": {\n",
" \"alleinerziehend\": np.array([False, False, False]),\n",
" \"p_id_ehepartner\": np.array([1, 0, -1]),\n",
" \"p_id_elternteil_1\": np.array([-1, -1, 0]),\n",
" \"p_id_elternteil_2\": np.array([-1, -1, 1]),\n",
" \"p_id_lebenspartner\": np.array([1, 0, -1]),\n",
" },\n",
" \"geburtsjahr\": np.array([1985, 1985, 2020]),\n",
" \"kindergeld\": {\n",
Expand Down
51 changes: 12 additions & 39 deletions docs/tt_explanations/hh_concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The units are:
| Bedarfsgemeinschaft | arbeitslosengeld_2\_\_bg_id | Familiengemeinschaft except for children who have enough income to fend for themselves. Relevant unit for Bürgergeld / Arbeitslosengeld 2. | yes |
| Steuernummer | einkommensteuer\_\_sn_id | Spouses filing taxes jointly or individuals. | yes |
| Ehepartner | familie\_\_ehe_id | Couples that are either married or in a civil union. | yes |
| Einstandsgemeinschaft | arbeitslosengeld_2\_\_eg_id | A couple whose members are deemed to be responsible for each other. | yes |
| Einsatzgemeinschaft | grundsicherung\_\_eg_id | Einsatzgemeinschaft according to § 27 Abs. 2 SGB XII. Maximum of two generations, the relevant base unit for Grundsicherung im Alter / Sozialhilfe. | yes |

Note that GETTSIM handles only simple cases (`hh_id` = `fg_id` = `bg_id` = `wthh_id`)
out of the box. If you need to handle more complex cases, you will need to pass all of
Expand Down Expand Up @@ -89,8 +89,7 @@ the [dedicated repository](https://github.com/ttsim-dev/gettsim-crazy-grouping-r

### Pointers

- `arbeitslosengeld_2__p_id_einstandspartner` until 2022;
`bürgergeld__p_id_einstandspartner` since 2023 (exogenous)
- `familie__p_id_lebenspartner` (exogenous)
- `familie__p_id_elternteil_1`, `familie__p_id_elternteil_2` (exogenous)

## Elterngeld
Expand Down Expand Up @@ -167,7 +166,7 @@ the [dedicated repository](https://github.com/ttsim-dev/gettsim-crazy-grouping-r
#### Description

- Bedarfsgemeinschaft comprised of:
- Einstandsgemeinschaft (SGB II - max 2 adults, marriage-like relationships)
- A couple (Lebenspartner) whose members are deemed to be responsible for each other
- Children under 18/25 whose income does not exceed their own needs. - The
"Kinderwohngeld" allows children to leave the Bedarfsgemeinschaft if Wohngeld (and
other sourced of income) is sufficient to cover their needs. Not implemented yet.
Expand All @@ -182,8 +181,7 @@ the [dedicated repository](https://github.com/ttsim-dev/gettsim-crazy-grouping-r

#### Pointers

- `arbeitslosengeld_2__p_id_einstandspartner` until 2022;
`bürgergeld__p_id_einstandspartner` since 2023 (exogenous)
- `familie__p_id_lebenspartner` (exogenous)
- `familie__p_id_elternteil_1`, `familie__p_id_elternteil_2` (exogenous)

### SGB XII (Hilfe zum Lebensunterhalt)
Expand All @@ -192,7 +190,7 @@ the [dedicated repository](https://github.com/ttsim-dev/gettsim-crazy-grouping-r

Government expenditures: 1.5 Mrd €

- Entitled to benefits: Einstandsgemeinschaft (SGB XII) - §27 SGB XII
- Entitled to benefits: Einsatzgemeinschaft (SGB XII) - §27 SGB XII
- max 2 adults, marriage-like relationships
- Their children under 18 living in the same household whose income does not exceed
their own needs
Expand All @@ -214,14 +212,12 @@ Regarding the household definition:

#### Aggregation unit

- Not implemented yet. The current `arbeitslosengeld_2__eg_id`/`bürgergeld__eg_id` is
not sufficient as it doesn't include children (it follows the SGB II definition).
- `grundsicherung__eg_id` (Einsatzgemeinschaft)

#### Pointers

- `hh_id`
- `arbeitslosengeld_2__p_id_einstandspartner` until 2022;
`bürgergeld__p_id_einstandspartner` since 2023 (exogenous)
- `familie__p_id_lebenspartner` (exogenous)
- `familie__p_id_elternteil_1`, `familie__p_id_elternteil_2` (exogenous)

### SGB XII (Grundsicherung im Alter / bei Erwerbsminderung)
Expand All @@ -230,7 +226,7 @@ Regarding the household definition:

Government expenditures: 7 Mrd €

- Entitled to benefits: Einstandsgemeinschaft (SGB XII) - §27 SGB XII
- Entitled to benefits: Einsatzgemeinschaft (SGB XII) - §27 SGB XII
- max 2 adults, marriage-like relationships
- Their children under 18 living in the same household whose income does not exceed
their own needs
Expand All @@ -240,15 +236,11 @@ Government expenditures: 7 Mrd €

#### Aggregation unit

- Currently: `arbeitslosengeld_2__eg_id` until 2022; `bürgergeld__eg_id` since 2023
(endogenous)
- The current implementation of `arbeitslosengeld_2__eg_id`/`bürgergeld__eg_id` is not
sufficient as it doesn't include children (it follows the SGB II definition).
- `grundsicherung__eg_id` (Einsatzgemeinschaft, endogenous)

#### Pointers

- `arbeitslosengeld_2__p_id_einstandspartner` until 2022;
`bürgergeld__p_id_einstandspartner` since 2023 (exogenous)
- `familie__p_id_lebenspartner` (exogenous)
- `familie__p_id_elternteil_1`, `familie__p_id_elternteil_2` (exogenous)

### SGB XII (Eingliederungshilfe für Menschen mit Behinderung)
Expand Down Expand Up @@ -282,7 +274,7 @@ Government expenditures: 4 Mrd €
- Spouse / registered partner / life partner (as long as in same household)
- Parents (incl. step-, foster- and in-laws) (as long as in same household)
- Children (incl. step-, foster- and adopted children) (as long as in same household)
- "Einstandspartner": non-relatives living in the same household and sharing
- "Lebenspartner": non-relatives living in the same household and sharing
responsibility for each other (e.g. couples that are not married or in a civil
union) (as long as in same household)
- A community of responsibility or joint liability is regulated in § 7 Abs. 3a SGB
Expand Down Expand Up @@ -313,8 +305,7 @@ Government expenditures: 4 Mrd €
### Pointers

- `hh_id`
- `arbeitslosengeld_2__p_id_einstandspartner` until 2022;
`bürgergeld__p_id_einstandspartner` since 2023 (exogenous)
- `familie__p_id_lebenspartner` (exogenous)
- `familie__p_id_elternteil_1`, `familie__p_id_elternteil_2` (exogenous)

## Kinderwohngeld
Expand All @@ -327,24 +318,6 @@ Government expenditures: 4 Mrd €
- Does not happen automatically, but upon request by the parents
- Not implemented yet.

## Limitations

- Within a Wohngeldhaushalt, no distinction can be made between persons without
Einstandsverpflichtung according to SGB II or SGB XII and those with
Einstandsverpflichtung

- Can only show the two extreme cases

1. all non-vertical or partner relationships not a candidate for Haushaltsgemeinschaft
according to SGB II / SGB XII
1. all non-vertical or partner relationships are candidates for Haushaltsgemeinschaft
according to SGB II / SGB XII

Typically, 1. will be the solution (hurdles for joint economic activity are high).

- An alternative would be another ID variable that specifies Einstandsgemeinschaft
according to SGB II and SGB XII.

### Parts of the data not available

- Adult children exist, but not in the dataset
Expand Down
11 changes: 0 additions & 11 deletions src/gettsim/germany/arbeitslosengeld_2/inputs.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
"""Input columns."""

from __future__ import annotations

from gettsim.tt import FKType, policy_input


@policy_input(
start_date="2005-01-01",
end_date="2022-12-31",
foreign_key_type=FKType.MUST_NOT_POINT_TO_SELF,
)
def p_id_einstandspartner() -> int:
"""Identifier of Einstandspartner."""
8 changes: 4 additions & 4 deletions src/gettsim/germany/arbeitslosengeld_2/regelbedarf.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ def kindersatz_m_nach_regelbedarfsstufen_mit_sofortzuschlag(
def erwachsenensatz_m_bis_2010(
mehrbedarf_alleinerziehend_m: float,
kindersatz_m: float,
p_id_einstandspartner: int,
familie__p_id_lebenspartner: int,
regelsatz_anteilsbasiert: RegelsatzAnteilsbasiert,
) -> float:
"""Basic monthly subsistence / SGB II needs for adults without dwelling."""
# BG has 2 adults
if p_id_einstandspartner >= 0:
if familie__p_id_lebenspartner >= 0:
out = regelsatz_anteilsbasiert.basissatz * (
regelsatz_anteilsbasiert.erwachsen.je_erwachsener_bei_zwei_erwachsenen
)
Expand All @@ -224,12 +224,12 @@ def erwachsenensatz_m_bis_2010(
def erwachsenensatz_m_ab_2011(
mehrbedarf_alleinerziehend_m: float,
kindersatz_m: float,
p_id_einstandspartner: int,
familie__p_id_lebenspartner: int,
grundsicherung__regelbedarfsstufen: Regelbedarfsstufen,
) -> float:
"""Basic monthly subsistence / SGB II needs for adults without dwelling since 2011."""
# BG has 2 adults
if p_id_einstandspartner >= 0:
if familie__p_id_lebenspartner >= 0:
out = grundsicherung__regelbedarfsstufen.rbs_2
# This observation is not a child, so BG has 1 adult
elif kindersatz_m == 0.0:
Expand Down
7 changes: 1 addition & 6 deletions src/gettsim/germany/bürgergeld/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@

from __future__ import annotations

from gettsim.tt import FKType, policy_input
from gettsim.tt import policy_input


@policy_input(start_date="2023-01-01")
def bezug_im_vorjahr() -> bool:
"""Person received Bürgergeld in the last 12 months."""


@policy_input(start_date="2023-01-01", foreign_key_type=FKType.MUST_NOT_POINT_TO_SELF)
def p_id_einstandspartner() -> int:
"""Identifier of Einstandspartner."""
4 changes: 2 additions & 2 deletions src/gettsim/germany/bürgergeld/regelbedarf.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ def kindersatz_m_nach_regelbedarfsstufen_mit_sofortzuschlag(
def erwachsenensatz_m_ab_2011(
mehrbedarf_alleinerziehend_m: float,
kindersatz_m: float,
p_id_einstandspartner: int,
familie__p_id_lebenspartner: int,
grundsicherung__regelbedarfsstufen: Regelbedarfsstufen,
) -> float:
"""Basic monthly subsistence / SGB II needs for adults without dwelling."""
# BG has 2 adults
if p_id_einstandspartner >= 0:
if familie__p_id_lebenspartner >= 0:
out = grundsicherung__regelbedarfsstufen.rbs_2
# This observation is not a child, so BG has 1 adult
elif kindersatz_m == 0.0:
Expand Down
4 changes: 2 additions & 2 deletions src/gettsim/germany/elterngeld/elterngeld.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def anzahl_anträge_fg(claimed: bool, fg_id: int) -> int:
)
def bezugsmonate_partner_bis_2022(
bisherige_bezugsmonate: int,
arbeitslosengeld_2__p_id_einstandspartner: int,
familie__p_id_lebenspartner: int,
p_id: int,
) -> int:
pass
Expand All @@ -74,7 +74,7 @@ def bezugsmonate_partner_bis_2022(
)
def bezugsmonate_partner_ab_2023(
bisherige_bezugsmonate: int,
bürgergeld__p_id_einstandspartner: int,
familie__p_id_lebenspartner: int,
p_id: int,
) -> int:
pass
Expand Down
Loading
Loading