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

ENH: Interface, 2024 edition #781

Open hmgaudecker opened 4 months ago

hmgaudecker commented 4 months ago

Is your feature request related to a problem?

GETTSIM's interface is hard to use and inflexible. We discussed the direction we should be heading at the 2024 workshop; this issue summarizes the discussion and opens it for community members who were not present.

Several related issues:

Ease of use for newcomers

Problem

GETTSIM's approach of being precise and requiring all relevant inputs means that simple questions can only be answered either with a huge amount of input data or with detailed knowledge of the DAG (e.g., how to cut off the pensions calculations part of the DAG when we have a sample of 30-year olds and ignore DI).

Proposed solution

  1. Provide a repo in the ecosystem with default values for broadly defined "personas" (low-income households, rich people, families with children, pensioners, ...)
  2. Provide an interactive interfaces for selecting subgraphs (more below)

Ease of use with different datasets

Problem

It is very hard to see how GETTSIM's requirements match what is in the data. For any reasonable application, the graph is far too fine-grained. It is very hard to see what kinds of intermediate nodes there might be in the data already

Proposed solution

  1. Simple stuff: A higher-level view of the graph (just the upper-level keys in the hierarchical structure, like arbeitslosengeld_2, rentenversicherung, ... width of edges mirrors the amount of links between individual functions, click on an area opens the internal structure), coloring of nodes following the upper-level keys.
  2. Iterative protocol for setting up the graph
    1. User specifies the targets
    2. load policy functions (potentially including a reform)
    3. Select input variables (either just take all root nodes or interactive process outlined below)
    4. Use that directly if names in the data match, or provide a dictionary/yaml file (depending on calling language) with all required inputs, user can fill in values with the corresponding names in her dataset or a default value that will apply to all observations

Multiple calls of GETTSIM, potentially changing the length of the data, using data inputs for take-up

Problem

Some stuff needs to be done outside the graph (e.g., Günstigerprüfung with endogenous bg_ids). Sometimes, we want to use information from the data in order to calculate things (e.g., whether someone who has a Minijob contributes voluntarily to the pension insurance or not).

Proposed solution

Set up sparse dataset with duplicated observations (0/1 take up in the above example; no concern if Minijob is irrelevant), potentially call GETTSIM on subsets of the data in sequence. (needs more thought)

Interactive interface

MImmesberger commented 4 months ago

I think this perfectly summarizes the discussions we had, thanks for writing it up!