Exemplo n.º 1
0
def create_diff(baseline, policy, dump_output=False):
    pct_changes = macro_output.dump_diff_output(baseline, policy)

    if dump_output:
        pickle.dump(output, open("ogusa_output.pkl", "wb"))

    return pct_changes
Exemplo n.º 2
0
def create_diff(baseline, policy, dump_output=False):
    pct_changes = macro_output.dump_diff_output(baseline, policy)

    if dump_output:
        pickle.dump(output, open("ogusa_output.pkl", "wb"))

    return pct_changes
Exemplo n.º 3
0
def create_diff(baseline_dir, policy_dir, dump_output=False):
    '''
    This function finds the percentage changes in macro variables that
    result from the tax reform.

    Args:
        baseline_dir (str): path for directory with baseline policy
            results
    policy_dir (str): path for directory with reform policy results
    dump_output (bool): =True if want results saved to pickle

    Returns:
        pct_changes (Numpy array): [7,12] array, numpy array with pct
            changes in macro variables from baseline to reform for each
            year. Final column = steady state. Macro vars: Y, C, K, L,
            w, r, TR

    '''
    out = macro_output.dump_diff_output(baseline_dir, policy_dir)
    pct_changes, baseline_macros, policy_macros = out
    pct_changes_path = os.path.join(policy_dir, 'ClosedEconPctChanges.csv')
    np.savetxt(pct_changes_path, pct_changes, delimiter=",")
    if dump_output:
        pickle.dump(pct_changes, open("ogusa_output.pkl", "wb"))

    closed_econ_base_path = os.path.join(baseline_dir,
                                         'ClosedEconBaseline.csv')
    np.savetxt(closed_econ_base_path, baseline_macros, delimiter=",")

    closed_econ_policy_path = os.path.join(policy_dir, 'ClosedEconPolicy.csv')
    np.savetxt(closed_econ_policy_path, policy_macros, delimiter=",")

    return pct_changes
Exemplo n.º 4
0
def create_diff(baseline_dir, policy_dir, dump_output=False):
    """
    --------------------------------------------------------------------
    This function finds the percentage changes in macro variables that
    result from the tax reform.
    --------------------------------------------------------------------
    
    INPUTS:
    baseline_dir = string, path for directory with baseline policy results
    policy_dir   = string, path for directory with reform policy results
    dump_output  = boolean, =True if want results saved to pickle

    OTHER FUNCTIONS AND FILES CALLED BY THIS FUNCTION: 
    macro_output.dump_diff_output()

    OBJECTS CREATED WITHIN FUNCTION:
    pct_changes  = [7,12] array, numpy array with pct changes in macro variables 
                    from baseline to reform for each year 

    RETURNS:
    pct_changes

    OUTPUT: 
    ./ogusa_output{}.pkl

    --------------------------------------------------------------------
    """
    pct_changes = macro_output.dump_diff_output(baseline_dir, policy_dir)

    if dump_output:
        pickle.dump(pct_changes, open("ogusa_output.pkl", "wb"))

    return pct_changes
Exemplo n.º 5
0
def create_diff(baseline_dir, policy_dir, dump_output=False):
    '''
    --------------------------------------------------------------------
    This function finds the percentage changes in macro variables that
    result from the tax reform.
    --------------------------------------------------------------------
    
    INPUTS:
    baseline_dir = string, path for directory with baseline policy results
    policy_dir   = string, path for directory with reform policy results
    dump_output  = boolean, =True if want results saved to pickle

    OTHER FUNCTIONS AND FILES CALLED BY THIS FUNCTION: 
    macro_output.dump_diff_output()

    OBJECTS CREATED WITHIN FUNCTION:
    pct_changes  = [7,12] array, numpy array with pct changes in macro variables 
                    from baseline to reform for each year 

    RETURNS:
    pct_changes

    OUTPUT: 
    ./ogusa_output{}.pkl

    --------------------------------------------------------------------
    '''
    pct_changes = macro_output.dump_diff_output(baseline_dir, policy_dir)

    if dump_output:
        pickle.dump(pct_changes, open("ogusa_output.pkl", "wb"))

    return pct_changes
Exemplo n.º 6
0
def macro_outputs(request):
    (pct_changes, baseline_macros,
     policy_macros) = dump_diff_output(BASELINE,
                                       REFORM.format(ref_idx=request.param))
    (reg_pct_changes, reg_baseline_macros,
     reg_policy_macros) = dump_diff_output(
         REG_BASELINE, REG_REFORM.format(ref_idx=request.param))

    return {
        "new": {
            "pct_changes": pct_changes,
            "baseline_macros": baseline_macros,
            "policy_macros": policy_macros
        },
        "reg": {
            "pct_changes": reg_pct_changes,
            "baseline_macros": reg_baseline_macros,
            "policy_macros": reg_policy_macros
        },
    }
Exemplo n.º 7
0
def macro_outputs(request):
    (pct_changes,
        baseline_macros,
        policy_macros) = dump_diff_output(
            BASELINE, REFORM.format(ref_idx=request.param))
    (reg_pct_changes,
        reg_baseline_macros,
        reg_policy_macros) = dump_diff_output(
            REG_BASELINE, REG_REFORM.format(ref_idx=request.param))

    return {"new": {
                    "pct_changes": pct_changes,
                    "baseline_macros": baseline_macros,
                    "policy_macros": policy_macros
                   },
            "reg": {
                    "pct_changes": reg_pct_changes,
                    "baseline_macros": reg_baseline_macros,
                    "policy_macros": reg_policy_macros
                    },
            }
Exemplo n.º 8
0
def create_diff(baseline_dir, policy_dir, dump_output=False):
    '''
    --------------------------------------------------------------------
    This function finds the percentage changes in macro variables that
    result from the tax reform.
    --------------------------------------------------------------------

    INPUTS:
    baseline_dir = string, path for directory with baseline policy results
    policy_dir   = string, path for directory with reform policy results
    dump_output  = boolean, =True if want results saved to pickle

    OTHER FUNCTIONS AND FILES CALLED BY THIS FUNCTION:
    macro_output.dump_diff_output()

    OBJECTS CREATED WITHIN FUNCTION:
    pct_changes  = [7,12] array, numpy array with pct changes in macro
                   variables from baseline to reform for each year.
                   Final column = steady state.
                   Macro vars: Y, C, K, L, w, r, T_H

    RETURNS:
    pct_changes

    OUTPUT:
    ./ogusa_output{}.pkl

    --------------------------------------------------------------------
    '''
    out = macro_output.dump_diff_output(baseline_dir, policy_dir)
    pct_changes, baseline_macros, policy_macros = out
    pct_changes_path = os.path.join(policy_dir, 'ClosedEconPctChanges.csv')
    np.savetxt(pct_changes_path, pct_changes, delimiter=",")
    if dump_output:
        pickle.dump(pct_changes, open("ogusa_output.pkl", "wb"))

    closed_econ_base_path = os.path.join(baseline_dir,
                                         'ClosedEconBaseline.csv')
    np.savetxt(closed_econ_base_path, baseline_macros, delimiter=",")

    closed_econ_policy_path = os.path.join(policy_dir, 'ClosedEconPolicy.csv')
    np.savetxt(closed_econ_policy_path, policy_macros, delimiter=",")

    return pct_changes