Skip to content

Conversation

@mjbloemer
Copy link
Collaborator

@mjbloemer mjbloemer commented Aug 29, 2024

This PR implements Unterhaltsvorschuss for the years 2009 to 2016.

Closes #566
Closes #479

Implementation before 2009 will be a separate PR once this is done.

Tests/comparison

Test with synthetic household middle age group child (6-11)

data = create_synthetic_data(
    n_adults=1,
    n_children=1,
    specs_constant_over_households={"bruttolohn_m": [0.0, 0.0], "alter": [35, 7]},
)
GETTSIM ifo Wiki Other source Rule
2009-01 158.00 (158.00) 158 _unterhaltsvors_anspruch_kind_m_2009_bis_2014
2009-03 158.00 (158.00) 158 _unterhaltsvors_anspruch_kind_m_2009_bis_2014
2009-07 158.00 158.00 158 BMFSFJ _unterhaltsvors_anspruch_kind_m_2009_bis_2014
2010-01 180.00 180.00 180 BMFSFJ _unterhaltsvors_anspruch_kind_m_2009_bis_2014
2011-01 180.00 180.00 180 _unterhaltsvors_anspruch_kind_m_2009_bis_2014
2012-01 180.00 180.00 180 _unterhaltsvors_anspruch_kind_m_2009_bis_2014
2013-01 180.00 180.00 180 _unterhaltsvors_anspruch_kind_m_2009_bis_2014
2014-01 180.00 180.00 180 _unterhaltsvors_anspruch_kind_m_2009_bis_2014
2015-01 180.00 (180.00) 180 4 _unterhaltsvors_anspruch_kind_m_anwendungsvors
2015-07 192.00 192.00 192 4 _unterhaltsvors_anspruch_kind_m_anwendungsvors
2016-01 194.00 (194.00) 194 3 _unterhaltsvors_anspruch_kind_m_2016
2016-07 194.00 194.00 194 3 _unterhaltsvors_anspruch_kind_m_2016
2017-01 201.00 (201.00) 201 BMFSFJ _unterhaltsvors_anspruch_kind_m_ab_2017
2017-07 201.00 201.00 201 BMFSFJ _unterhaltsvors_anspruch_kind_m_ab_2017
2018-01 205.00 205.00 205 BMFSFJ _unterhaltsvors_anspruch_kind_m_ab_2017
2019-01 212.00 (212.00) 212 BMFSFJ _unterhaltsvors_anspruch_kind_m_ab_2017
2019-07 202.00 202.00 202 BMFSFJ _unterhaltsvors_anspruch_kind_m_ab_2017
2020-01 220.00 220.00 220 BMFSFJ _unterhaltsvors_anspruch_kind_m_ab_2017
2021-01 232.00 232.00 232 Familienportal _unterhaltsvors_anspruch_kind_m_ab_2017
2022-01 236.00 236.00 236 2 _unterhaltsvors_anspruch_kind_m_ab_2017
2023-01 252.00 252.00 252 1 _unterhaltsvors_anspruch_kind_m_ab_2017
2024-01 301.00 301.00 301 BMFSFJ _unterhaltsvors_anspruch_kind_m_ab_2017

Test with synthetic household, lower age group child (0-5)

data = create_synthetic_data(
    n_adults=1,
    n_children=1,
    specs_constant_over_households={"bruttolohn_m": [0.0, 0.0], "alter": [35, 5]},
)
GETTSIM ifo Wiki
2009-01 117.00 116.14* 117
2010-01 133.00 132.68* 133
2015-01 133.00 133
2015-07 144.00 143.12* 144
2016-07 145.00 145.00 145
2017-01 150.00 (150.00) 150
2017-07 150.00 150.00 150
2018-01 154.00 154.00 154
2019-01 160.00 (160.00) 160
2019-07 150.00 150.00 150
2020-01 165.00 165.00 165
2024-01 230.00 230.00 230

*no rounding rule applied

Test with synthetic household, upper age group child (12-17), 0 gross income:

data = create_synthetic_data(
    n_adults=1,
    n_children=1,
    specs_constant_over_households={"bruttolohn_m": [0.0, 0.0], "alter": [35, 15]},
)
GETTSIM ifo Wiki
2016-07 0 0 -
2017-01 0 (0) -
2017-07 0 0 -
2018-01 0 0 -
2024-01 0 0 -

Test with synthetic household, upper age group child (12-17), 600 Euro gross income:

data = create_synthetic_data(
    n_adults=1,
    n_children=1,
    specs_constant_over_households={"bruttolohn_m": [600.0, 0.0], "alter": [35, 15]},
)
GETTSIM ifo Wiki
2016-07 0 0 -
2017-01 0 (0) -
2017-07 268.00 268.00 268
2018-01 273.00 273.00 273
2024-01 395.00 395.00 395

@mjbloemer mjbloemer added documentation Improvements or additions to documentation tax-transfer-feature This relates to a feature of the Taxes and Transfers system or reforms thereof labels Aug 29, 2024
@mjbloemer mjbloemer self-assigned this Aug 29, 2024
@mjbloemer mjbloemer changed the title Draft: Add unterhaltsvors implementation 2008 to 2016 Draft: Add unterhaltsvors implementation 2009 to 2016 Aug 29, 2024
@codecov
Copy link

codecov bot commented Aug 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.99%. Comparing base (5ca6157) to head (b0492d1).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #790      +/-   ##
==========================================
+ Coverage   89.85%   89.99%   +0.13%     
==========================================
  Files          53       53              
  Lines        3834     3857      +23     
==========================================
+ Hits         3445     3471      +26     
+ Misses        389      386       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mjbloemer mjbloemer changed the title Draft: Add unterhaltsvors implementation 2009 to 2016 Add unterhaltsvors implementation 2009 to 2016 Aug 30, 2024
@mjbloemer mjbloemer marked this pull request as ready for review August 30, 2024 10:27
Copy link
Collaborator

@MImmesberger MImmesberger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for implementing this!

Just one clarification question that a quick google search couldn't answer.

Regarding the tests: I will translate the official documents you linked to test files in the next days. For the other functions where only ifo comparisons are available, I will create regression tests.

@mjbloemer mjbloemer marked this pull request as draft September 3, 2024 09:07
@mjbloemer mjbloemer marked this pull request as ready for review September 3, 2024 11:19
Copy link
Collaborator

@MImmesberger MImmesberger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

I added the tests based on the tables above.

@hmgaudecker do you want to have a last look? Also, the yamlfix hook fails here and on #756. A quick google search didn't yield a result, any idea?

@hmgaudecker
Copy link
Collaborator

Also, the yamlfix hook fails here and on #756. A quick google search didn't yield a result, any idea?

Probably a bug in 1.16, seems like an autoupdate helped?

Copy link
Collaborator

@hmgaudecker hmgaudecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks!

Just some tiny stuff, which is only related to big pic questions, not newly introduced parameters here. Feel free to implement, @MImmesberger, or open a more general issue for that.

out = mindestunterhalt[altersgrenzen[2]] - _kindergeld_erstes_kind_m
elif altersgrenzen[2] <= alter < altersgrenzen[3]:
out = mindestunterhalt[altersgrenzen[3]] - _kindergeld_erstes_kind_m
if mindestunterhalt[1]["min_alter"] <= alter <= mindestunterhalt[1]["max_alter"]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switched to the age thresholds of the Mindestunterhalt here, because the value of the transfer is taken from there as well. Makes it less error prone in the future imo.

Then, the age thresholds in the UV params file are not used after 2016, so I removed the 2017 reform from there.

Do you agree?

Copy link
Collaborator

@hmgaudecker hmgaudecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies this is dragging on -- I should have had a careful look earlier!

Copy link
Collaborator

@hmgaudecker hmgaudecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks a lot @mjbloemer and @MImmesberger !!!

@MImmesberger MImmesberger merged commit 5d81581 into main Sep 6, 2024
@MImmesberger MImmesberger deleted the uvors_bis_2016 branch September 6, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation tax-transfer-feature This relates to a feature of the Taxes and Transfers system or reforms thereof

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENH: Expand and improve parameters for Unterhaltsvorschuss BUG: Parameters for "minimum child alimony" before 2016 are missing in "unterhalt.yaml"

4 participants