-
Notifications
You must be signed in to change notification settings - Fork 31
Update Elterngeld #756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Update Elterngeld #756
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
263c51b
Update elterngeld.py
ThOrtmann 35bebb0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c200412
Update hh_id_1.yaml
ThOrtmann 0a2894e
Update hh_id_1.yaml
ThOrtmann b781e65
Update hh_id_8.yaml
ThOrtmann 43af73b
Update test_full_taxes_and_transfers.py
ThOrtmann efb8be5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2825933
Update test_full_taxes_and_transfers.py
ThOrtmann d5eb80b
Update hh_id_3.yaml
ThOrtmann 47a8a55
Update test_full_taxes_and_transfers.py
ThOrtmann 5e189fc
Update elterngeld.py
ThOrtmann 4e7c419
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] e08ad61
Update elterngeld.yaml
ThOrtmann ad6122d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] f5550a4
Update elterngeld.yaml
ThOrtmann d469b81
Update elterngeld.py
ThOrtmann 9dea761
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 712436a
Fix indentation error.
hmgaudecker 08c750a
Merge branch 'some_elterngeld_fixes' of github.com:iza-institute-of-l…
hmgaudecker de1e7cc
Closes #756
ThOrtmann e8827b6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 5aaca2a
Updated Tests as well as the config.py files to
ThOrtmann 9bbed96
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 0c1a608
updated max_eink parameters
ThOrtmann dea89c7
Merge branch 'main' into some_elterngeld_fixes
MImmesberger 5a1aaa8
Update parameter file.
MImmesberger df8819f
Start to adjust module to new machinery.
MImmesberger dd67b37
Add todos.
MImmesberger 981db5c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 8bf8a37
Continue with Geschwisterbonus and move Elterngeld eligibility to fg …
MImmesberger fe5565d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2bcadea
Continue with restructuring, income t-1 and empfänger still missing.
MImmesberger d94e183
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c35e08b
Finish restructuring, still need to adjust net wage approximation.
MImmesberger 7b52bfb
Add Elterngeld Nettolohn Vorjahr target and do some clean up.
MImmesberger 80f7fb2
Fix vectorization test.
MImmesberger 8ab7c03
Credits.
MImmesberger a80127f
Change anrechenbares Einkommen and adjust some test files.
MImmesberger 9f6b837
Fix full_tt tests, more clean up.
MImmesberger f7ace99
Fix regression test.
MImmesberger e007f5d
Adjust Elterngeld tests.
MImmesberger 15b9ee7
Add regression tests for 2024.
MImmesberger b8ee997
Typos.
MImmesberger 559bf07
Remove old target.
MImmesberger 933c9a9
Test net wage approximation.
MImmesberger 6af4eba
Clean up.
MImmesberger 6dea561
Jakobs comments.
MImmesberger 7655609
Some more fixes.
MImmesberger 52e1179
Merge branch 'main' into some_elterngeld_fixes
MImmesberger 3ac1da2
First set of comments.
MImmesberger caf1a09
Optional smoothing of replacement rate.
MImmesberger 86915e6
Update hooks so that we don't end up with conflicts in policy-functio…
hmgaudecker 242e84c
Fix bug and add regression test.
MImmesberger fa34d53
Merge branch 'some_elterngeld_fixes' of https://github.com/iza-instit…
MImmesberger da4b008
Add notebook howto Elterngeld calculation.
MImmesberger f6e2129
Update a paragraph.
hmgaudecker 02c01ce
Adjust notebook and round Elterngeld.
MImmesberger d4e13c5
Fix bug that occurs after May 2024.
MImmesberger 37b7df5
Update text with gist of Github discussion.
hmgaudecker 0892ca6
Adjust notebook slightly.
MImmesberger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,243 @@ | ||
| { | ||
| "cells": [ | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "# How to calculate Elterngeld\n", | ||
| "\n", | ||
| "Elterngeld (parental leave benefit) is a financial support for parents in the first\n", | ||
| "months after the birth of a child. It replaces some share of the income before birth\n", | ||
| "(usually about 67% of net income). This net income is approximated using simplified\n", | ||
| "calculation rules. This document explains how to calculate Elterngeld\n", | ||
| "based on historical income data for a given household.\n", | ||
| "\n", | ||
| "In principle, one can compute Elterngeld in three steps:\n", | ||
| "1. Compute the average monthly gross income before birth in the data.\n", | ||
| "2. Call GETTSIM with the target `elterngeld_nettolohn_approximation_m` using the policy\n", | ||
| " environment of the year **before** the child was born.\n", | ||
| "3. Call GETTSIM with the target `elterngeld_m` using the outcome of step 2 as the input\n", | ||
| " for `elterngeld_nettoeinkommen_vorjahr_m` and the policy environment of the year the\n", | ||
| " child was born.\n", | ||
| "\n", | ||
| "In the following, we will explain some more details." | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "## Example\n", | ||
| "\n", | ||
| "In the following, we compute Elterngeld for a child that is born in July 2024. The\n", | ||
| "parent that receives Elterngeld had a monthly gross wage of 2,000€ in the 12 months\n", | ||
| "before birth of the child.\n", | ||
| "\n", | ||
| "You can find an exemplary Elterngeld application form of the state of Bavaria\n", | ||
| "[here](https://www.zbfs.bayern.de/imperia/md/content/zbfs_intranet/produktgruppe_i/formulare/beeg-antrag/2021_09_anlage_n_mit_info_.pdf).\n", | ||
| "\n", | ||
| "### Step 1: Compute the average monthly gross income before birth\n", | ||
| "\n", | ||
| "If income from dependent employment is the only source of income, the basis for the\n", | ||
| "Elterngeld calculation is the average monthly gross income in the 12 months before the\n", | ||
| "birth of a child. In our case, this would be July 2023 until June 2024. If other income\n", | ||
| "sources exist, the basis is the average monthly gross income in the calendar year before\n", | ||
| "the birth of the child, 2023 in our example. We will stick to the first case here\n", | ||
| "because it is the only thing that GETTSIM will handle directly right now.\n", | ||
| "\n", | ||
| "> **Note**: The Elterngeld implementation in GETTSIM does currently not consider income\n", | ||
| "> from self-employment or other sources. See\n", | ||
| "> [this](https://github.com/iza-institute-of-labor-economics/gettsim/issues/613) issue.\n", | ||
| "\n", | ||
| "So let's assume that income from dependent employment is the only source of income. If\n", | ||
| "you have only annual income data (and thus cannot compute gross income 12 months before\n", | ||
| "birth exactly), you must choose an approximation. In most cases, a good approximation is\n", | ||
| "the income of the year before birth.\n", | ||
| "\n", | ||
| "Here, we use made-up data using the `create_synthetic_data` function." | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "from gettsim import (\n", | ||
| " compute_taxes_and_transfers,\n", | ||
| " create_synthetic_data,\n", | ||
| " set_up_policy_environment,\n", | ||
| ")" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "The correct point in time for the data, i.e., the relevant state variables for\n", | ||
| "determining the net wage, are an interesting case. Many of those may change over time.\n", | ||
| "The relevant part is:\n", | ||
| "\n", | ||
| "> Die entsprechenden Abzugsmerkmale werden den Lohn- oder Gehaltsabrechnungen entnommen.\n", | ||
| "> Grundsätzlich sind die Abzugsmerkmale maßgeblich, die in der überwiegenden Zahl der\n", | ||
| "> Monate des Bemessungszeitraums vor Geburt des Kindes gegolten haben.\n", | ||
| "\n", | ||
| "So it is up to the data preparer to find out which tax class (Lohnsteuerklasse), church\n", | ||
| "tax (Kirchensteuer), health insurance, etc. to set. The Lohnsteuerklasse, for example, is always set\n", | ||
| "on a yearly basis; if it changes with the start of the calendar year a child is born,\n", | ||
| "the date of birth matters. Up to June, the Lohnsteuerklasse from the previous calendar\n", | ||
| "year will be relevant; for July or later, the Lohnsteuerklasse from the current calendar\n", | ||
| "year will be relevant." | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "data_before_birth = create_synthetic_data(\n", | ||
| " n_adults=2,\n", | ||
| " n_children=0,\n", | ||
| " specs_heterogeneous={\n", | ||
| " \"bruttolohn_m\": [[2000.0, 0.0]],\n", | ||
| " },\n", | ||
| ")" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "### Step 2: Approximate net wage before birth\n", | ||
| "\n", | ||
| "GETTSIM provides an easy way to compute the relevant net wage\n", | ||
| "`elterngeld_nettoeinkommen_vorjahr_m` based on step 1 using the target\n", | ||
| "`elterngeld_nettolohn_approximation_m`.\n", | ||
| "\n", | ||
| "We use the policy environment of January 1st of the year before the child was born (§2e\n", | ||
| "Abs. 1 S. 2 BEEG). Note that this is correct regardless of the point in time when the\n", | ||
| "child is born\n", | ||
| "\n", | ||
| "In our case, this is January 1st, 2023." | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "params_2023, functions_2023 = set_up_policy_environment(2023)\n", | ||
| "\n", | ||
| "net_wage_approximation = compute_taxes_and_transfers(\n", | ||
| " data=data_before_birth,\n", | ||
| " functions=functions_2023,\n", | ||
| " params=params_2023,\n", | ||
| " targets=[\"elterngeld_nettolohn_approximation_m\"],\n", | ||
| ")\n", | ||
| "\n", | ||
| "net_wage_approximation" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "### Step 3: Compute Elterngeld\n", | ||
| "\n", | ||
| "Finally, we can compute Elterngeld using the target `elterngeld_m` and the net wage\n", | ||
| "information from step 2.\n", | ||
| "\n", | ||
| "The reason for not doing this in one GETTSIM call (together with step 2) is that \n", | ||
| "1. we have to use different policy environment dates for the two steps, and\n", | ||
| "2. other state variables of the household (e.g. place of residence) might change\n", | ||
| "after birth of the child.\n", | ||
| "\n", | ||
| "First, we create the new data set after birth." | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "# Create data\n", | ||
| "params, functions = set_up_policy_environment(2023)\n", | ||
| "\n", | ||
| "data_after_birth = create_synthetic_data(\n", | ||
| " n_adults=2,\n", | ||
| " n_children=1,\n", | ||
| " specs_heterogeneous={\n", | ||
| " \"bruttolohn_m\": [[0.0, 0.0, 0.0]],\n", | ||
| " \"geburtsjahr\": [[1980, 1980, 2024]],\n", | ||
| " \"geburtsmonat\": [[1, 1, 7]],\n", | ||
| " \"alter\": [[44, 44, 0]],\n", | ||
| " \"elterngeld_claimed\": [[True, False, False]], # First adult claims Elterngeld\n", | ||
| " },\n", | ||
| ")" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "Then, we add `elterngeld_nettoeinkommen_vorjahr_m` to the data based on step 2." | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "# Add net wage approximation\n", | ||
| "data_after_birth[\"elterngeld_nettoeinkommen_vorjahr_m\"] = net_wage_approximation[\n", | ||
| " \"elterngeld_nettolohn_approximation_m\"\n", | ||
| "]" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "Then, we compute Elterngeld using the policy environment of the child's birthday." | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "params_2024, functions_2024 = set_up_policy_environment(\"2024-07-01\")\n", | ||
| "\n", | ||
| "# Compute Elterngeld\n", | ||
| "results = compute_taxes_and_transfers(\n", | ||
| " data=data_after_birth,\n", | ||
| " functions=functions_2024,\n", | ||
| " params=params_2024,\n", | ||
| " targets=[\"elterngeld_m\"],\n", | ||
| ")\n", | ||
| "\n", | ||
| "results" | ||
| ] | ||
| } | ||
| ], | ||
| "metadata": { | ||
| "language_info": { | ||
| "codemirror_mode": { | ||
| "name": "ipython", | ||
| "version": 3 | ||
| }, | ||
| "file_extension": ".py", | ||
| "mimetype": "text/x-python", | ||
| "name": "python", | ||
| "nbconvert_exporter": "python", | ||
| "pygments_lexer": "ipython3" | ||
| } | ||
| }, | ||
| "nbformat": 4, | ||
| "nbformat_minor": 2 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,4 +11,5 @@ maxdepth: 1 | |
| --- | ||
| different_ways_to_load_policy_functions | ||
| visualizing_the_system | ||
| calculating_elterngeld | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.