iza-institute-of-labor-economics / gettsim

The GErman Taxes and Transfers SIMulator
https://gettsim.readthedocs.io/
GNU Affero General Public License v3.0
56 stars 33 forks source link

Reduce calculation of wohngeld to right level #218

Closed MaxBlesch closed 1 year ago

MaxBlesch commented 4 years ago

Current and desired situation

Wohngeld is calculated right now on individual level and then reduced to the household level. We should exploit this structure and reduce calculation to the household level initially. We need to account for multiple tax units in a household when doing so. See below for details in the old code.

Proposed implementation

Reduce calculation to the household level.

Considered alternatives

def wohngeld_vor_vermög_check_m_hh(
    hh_id: IntSeries, wohngeld_vor_vermög_check_m: FloatSeries
) -> FloatSeries:
    """Calculate preliminary housing benefit per household.

    Social benefit for recipients with income above basic social assistance Computation
    is very complicated, accounts for household size, income, actual rent and differs on
    the municipality level ('Mietstufe' (1,...,6)).

    We usually don't have information on the last item. Therefore we assume 'Mietstufe'
    3, corresponding to an average level, but other Mietstufen can be specified in
    `household`.

    Benefit amount depends on parameters `wohngeld_miete_m` (rent) and
    `wohngeld_eink_m` (income) (§19 WoGG).

    Parameters
    ----------
    hh_id
        See basic input variable :ref:`hh_id <hh_id>`.
    wohngeld_vor_vermög_check_m
        See :func:`wohngeld_vor_vermög_check_m`.

    Returns
    -------

    """
    # ToDo: When thinking about calculating wohngeld on the correct level, we need
    # account for multiple tax units in one household. The following is the old code!
    # See #218.
    # out = (wohngeld_vor_vermög_check_m * tu_vorstand).groupby(hh_id).sum().round(2)
    out = wohngeld_vor_vermög_check_m.groupby(hh_id).max().round(2)
    return out
hmgaudecker commented 4 years ago

Please use this occasion to also fix the function names. E.g., wohngeld_basis_hh should be wohngeld_basis_m_hh. Even though we do not have checks as for _hh / _tu, we should strive to be consistent on any deviations from annual measures, also for internal and sort-of-internal variables.

hmgaudecker commented 2 years ago

@ChristianZimpelmann, can you please check this one, potentially assigning someone to do it? At least the naming is still wrong.

ChristianZimpelmann commented 2 years ago

Will do. I assigned the priority-high label. I think it would be a good idea to use those labels to indicate urgent issues.

ChristianZimpelmann commented 2 years ago

This doesn't seem to be fixed, yet.

I am not sure why income and rent are calculated on the tax unit level in the first place. If I understand correctly, the tax unit should not be relevant here, but always the full household: https://www.wohngeld.org/haushaltsmitglieder.html

Unrelated household members do not count for Wohngeld, but if I am not mistaken they also don't count for other transfers.. so we shouldn't have them in the same hh_id.

@MaxBlesch @Eric-Sommer @mjbloemer

ChristianZimpelmann commented 2 years ago

Similar problems also exist for the calculation of Kinderzuschlag and Elterngeld where we use both tax-unit-wide and household-wide variables in an inconsistent way.

We need to do the following:

hmgaudecker commented 1 year ago

Still open? Anything here that is not in #379?

ChristianZimpelmann commented 1 year ago

Thanks! This is indeed fixed by #418.