Output Table Functions#

**output_tabls.py modules*

ogcore.output_tables#

ogcore.output_tables.dynamic_revenue_decomposition(base_params, base_tpi, base_ss, reform_params, reform_tpi, reform_ss, num_years=10, include_SS=True, include_overall=True, include_business_tax=True, full_break_out=False, start_year=2021, table_format=None, path=None)[source]#

This function decomposes the source of changes in tax revenues to determine the percentage change in tax revenues that can be attributed to macroeconomic feedback effects.

Parameters:
  • base_params (OG-Core Specifications class) – baseline parameters object

  • base_tpi (dictionary) – TP output from baseline run

  • base_ss (dictionary) – SS output from baseline run

  • reform_params (OG-Core Specifications class) – reform parameters object

  • reform_tpi (dictionary) – TP output from reform run

  • reform_ss (dictionary) – SS output from reform run

  • num_years (integer) – number of years to include in table

  • include_SS (bool) – whether to include the steady-state results in the table

  • include_overall (bool) – whether to include results over the entire budget window as a column in the table

  • include_business_tax (bool) – whether to include business tax revenue changes in result

  • full_break_out (bool) – whether to break out behavioral and macro effects

  • start_year (integer) – year to start table

  • table_format (string) – format to return table in: ‘csv’, ‘tex’, ‘excel’, ‘json’, if None, a DataFrame is returned

  • path (string) – path to save table to

Returns:

table in DataFrame or string format or None

if saved to disk

Return type:

table (various)

Note

The decomposition is the following: 1. Simulate the baseline and reform in OG-Core. Save the

resulting series of tax revenues. Call these series for the baseline and reform A and D, respectively.

  1. Create a third revenue series that is computed using the baseline behavior (i.e., bmat_s and n_mat) and macro variables (tr, bq, r, w), but with the tax function parameter estimates from the reform policy. Call this series B.

  2. Create a fourth revenue series that is computed using the reform behavior (i.e., bmat_s and n_mat) and tax functions estimated on the reform tax policy, but the macro variables (tr, bq, r, w) from the baseline. Call this series C.

  1. Calculate the percentage difference between B and A – call this the “static” change from the macro model. Calculate the percentage difference between C and B – call this the behavioral effects. Calculate the percentage difference between D and C – call this the macroeconomic effect. The full dynamic effect is difference between C and A.

One can apply the percentage difference from the macro feedback effect to (“static”) revenue estimates from the policy change to produce an estimate of the revenue including macro feedback.

ogcore.output_tables.gini_table(base_ss, base_params, reform_ss=None, reform_params=None, var_list=['cssmat'], table_format=None, path=None)[source]#

Creates table with measures of the Gini coefficient: overall, across lifetime earnings group, and across age.

Parameters:
  • base_ss (dictionary) – SS output from baseline run

  • base_params (OG-Core Specifications class) – baseline parameters object

  • reform_ss (dictionary) – SS output from reform run

  • reform_params (OG-Core Specifications class) – reform parameters object

  • var_list (list) – names of variable to use in table

  • table_format (string) – format to return table in: ‘csv’, ‘tex’, ‘excel’, ‘json’, if None, a DataFrame is returned

  • path (string) – path to save table to

Returns:

table in DataFrame or string format or None

if saved to disk

Return type:

table (various)

ogcore.output_tables.ineq_table(base_ss, base_params, reform_ss=None, reform_params=None, var_list=['cssmat'], table_format=None, path=None)[source]#

Creates table with various inequality measures in the model steady-state.

Parameters:
  • base_ss (dictionary) – SS output from baseline run

  • base_params (OG-Core Specifications class) – baseline parameters object

  • reform_ss (dictionary) – SS output from reform run

  • reform_params (OG-Core Specifications class) – reform parameters object

  • var_list (list) – names of variable to use in table

  • table_format (string) – format to return table in: ‘csv’, ‘tex’, ‘excel’, ‘json’, if None, a DataFrame is returned

  • path (string) – path to save table to

Returns:

table in DataFrame or string format or None

if saved to disk

Return type:

table (various)

ogcore.output_tables.macro_table(base_tpi, base_params, reform_tpi=None, reform_params=None, var_list=['Y', 'C', 'K', 'L', 'r', 'w'], output_type='pct_diff', stationarized=True, num_years=10, include_SS=True, include_overall=True, start_year=2021, table_format=None, path=None)[source]#

Create a table of macro aggregates.

Parameters:
  • base_tpi (dictionary) – TPI output from baseline run

  • base_params (OG-Core Specifications class) – baseline parameters object

  • reform_tpi (dictionary) – TPI output from reform run

  • reform_params (OG-Core Specifications class) – reform parameters object

  • var_list (list) – names of variable to use in table

  • output_type (string) –

    type of plot, can be: ‘pct_diff’: plots percentage difference between baselien

    and reform ((reform-base)/base)

    ’diff’: plots difference between baseline and reform (reform-base) ‘levels’: variables in model units

  • stationarized (bool) – whether used stationarized variables (False only affects pct_diff right now)

  • num_years (integer) – number of years to include in table

  • include_SS (bool) – whether to include the steady-state results in the table

  • include_overall (bool) – whether to include results over the entire budget window as a column in the table

  • start_year (integer) – year to start table

  • table_format (string) – format to return table in: ‘csv’, ‘tex’, ‘excel’, ‘json’, if None, a DataFrame is returned

  • path (string) – path to save table to

Returns:

table in DataFrame or string format or None

if saved to disk

Return type:

table (various)

ogcore.output_tables.macro_table_SS(base_ss, reform_ss, var_list=['Yss', 'Css', 'Kss', 'Lss', 'rss', 'wss'], table_format=None, path=None)[source]#

Create a table of macro aggregates from the steady-state solutions.

Parameters:
  • base_ss (dictionary) – SS output from baseline run

  • reform_ss (dictionary) – SS output from reform run

  • var_list (list) – names of variable to use in table

  • table_format (string) – format to return table in: ‘csv’, ‘tex’, ‘excel’, ‘json’, if None, a DataFrame is returned

  • path (string) – path to save table to

Returns:

table in DataFrame or string format or None

if saved to disk

Return type:

table (various)

ogcore.output_tables.tp_output_dump_table(base_params, base_tpi, reform_params=None, reform_tpi=None, table_format=None, path=None)[source]#

This function dumps many of the macro time series from the transition path into an output table.

Parameters:
  • base_params (OG-Core Specifications class) – baseline parameters object

  • base_tpi (dictionary) – TP output from baseline run

  • reform_params (OG-Core Specifications class) – reform parameters object

  • reform_tpi (dictionary) – TP output from reform run

  • table_format (string) – format to return table in: ‘csv’, ‘tex’, ‘excel’, ‘json’, if None, a DataFrame is returned

  • path (string) – path to save table to

Returns:

table in DataFrame or string format or None

if saved to disk

Return type:

table (various)

ogcore.output_tables.wealth_moments_table(base_ss, base_params, data_moments=None, table_format=None, path=None)[source]#

Creates table with moments of the wealth distribution from the model and SCF data.

Parameters:
  • base_ss (dictionary) – SS output from baseline run

  • base_params (OG-Core Specifications class) – baseline parameters object

  • table_format (string) – format to return table in: ‘csv’, ‘tex’, ‘excel’, ‘json’, if None, a DataFrame is returned

  • path (string) – path to save table to

Returns:

table in DataFrame or string format or None

if saved to disk

Return type:

table (various)