Skip to content

Commit

Permalink
Merge pull request #271 from salimfurth/reform_cleanup2
Browse files Browse the repository at this point in the history
Fixing error in SS & removing redundancy in TPI
  • Loading branch information
jdebacker authored Mar 10, 2017
2 parents d4a69c6 + be2e01c commit 18fb1f1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Python/ogusa/SS.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ def run_SS(income_tax_params, ss_params, iterative_params, chi_params, small_ope
baseline_ss_dir = os.path.join(
baseline_dir, "SS/SS_vars.pkl")
ss_solutions = pickle.load(open(baseline_ss_dir, "rb"))
[rguess, wguess, T_Hguess, factor] = [ss_solutions['wss'], ss_solutions['rss'], ss_solutions['T_Hss'], ss_solutions['factor_ss']]
[rguess, wguess, T_Hguess, factor] = [ss_solutions['rss'], ss_solutions['wss'], ss_solutions['T_Hss'], ss_solutions['factor_ss']]
ss_params_reform = [b_guess.reshape(S, J), n_guess.reshape(S, J), chi_params, ss_params, income_tax_params, iterative_params, factor, small_open_params]
guesses = [rguess, wguess, T_Hguess]
[solutions_fsolve, infodict, ier, message] = opt.fsolve(SS_fsolve_reform, guesses, args=ss_params_reform, xtol=mindist_SS, full_output=True)
Expand Down
14 changes: 7 additions & 7 deletions Python/ogusa/TPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,13 +708,13 @@ def run_TPI(income_tax_params, tpi_params, iterative_params, small_open_params,
T_H_new = alpha_T * Ynew


# Loop through years to calculate debt and gov't spending. The re-assignment of G0 & D0 is necessary because Y0 may change in the TPI loop.
if budget_balance == False:
G_0 = alpha_G * Ynew[0]
D_0 = initial_debt * Ynew[0]
other_dg_params = (T, r, g_n_vector, g_y)
dg_fixed_values = (Ynew, REVENUE, T_H, D_0,G_0)
D, G = fiscal.D_G_path(dg_fixed_values, fiscal_params, other_dg_params)
# # Loop through years to calculate debt and gov't spending. The re-assignment of G0 & D0 is necessary because Y0 may change in the TPI loop.
# if budget_balance == False:
# G_0 = alpha_G * Ynew[0]
# D_0 = initial_debt * Ynew[0]
# other_dg_params = (T, r, g_n_vector, g_y)
# dg_fixed_values = (Ynew, REVENUE, T_H, D_0,G_0)
# D, G = fiscal.D_G_path(dg_fixed_values, fiscal_params, other_dg_params)

w[:T] = utils.convex_combo(wnew[:T], w[:T], nu)
r[:T] = utils.convex_combo(rnew[:T], r[:T], nu)
Expand Down
8 changes: 4 additions & 4 deletions Python/run_ogusa_serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def run_micro_macro(user_params):
#p1 = Process(target=runner, kwargs=kwargs)
#p1.start()
runner(**kwargs)
quit()
#quit()

'''
------------------------------------------------------------------------
Expand All @@ -89,9 +89,9 @@ def run_micro_macro(user_params):
# input_dir = REFORM_DIR
# guid_iter = 'reform_' + str(0)
# kwargs={'output_base':output_base, 'baseline_dir':BASELINE_DIR,
# 'baseline':False, 'analytical_mtrs':False, 'age_specific':False,
# 'user_params':user_params,'guid':'_alt',
# 'reform':reform , 'run_micro':False, 'small_open': True}
# 'test':True, 'time_path':True, 'baseline':False, 'analytical_mtrs':False, 'age_specific':True,
# 'user_params':user_params,'guid':'_alt', 'reform':reform ,
# 'run_micro':False, 'small_open': False, 'budget_balance':False}
# #p2 = Process(target=runner, kwargs=kwargs)
# #p2.start()
# runner(**kwargs)
Expand Down

0 comments on commit 18fb1f1

Please sign in to comment.