Skip to content

Commit

Permalink
update calls to basleine in tpi
Browse files Browse the repository at this point in the history
  • Loading branch information
jdebacker committed Sep 14, 2024
1 parent 95e495c commit 7b43966
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions ogcore/TPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,11 +589,6 @@ def run_TPI(p, client=None):
Y = np.zeros_like(K)
Y[: p.T] = firm.get_Y(K[: p.T], K_g[: p.T], L[: p.T], p, "TPI")
Y[p.T :] = ss_vars["Yss"]
I_g = np.ones_like(Y) * ss_vars["I_g_ss"]
if p.baseline_spending:
I_g[: p.T] = Ig_baseline[: p.T]
else:
I_g = fiscal.get_I_g(Y[: p.T], None, p, "TPI")
if p.baseline:
K_g0 = p.initial_Kg_ratio * Y[0]
else:
Expand Down Expand Up @@ -663,11 +658,21 @@ def run_TPI(p, client=None):
D = np.zeros(p.T + p.S)
D_d = np.zeros(p.T + p.S)
D_f = np.zeros(p.T + p.S)
I_g = np.ones_like(Y) * ss_vars["I_g_ss"]
else:
if p.baseline_spending:
# Will set to TRbaseline here, but will be updated in TPI loop
# with call to fiscal.get_TR
TR = np.concatenate(
(TRbaseline[: p.T], np.ones(p.S) * ss_vars["TR_ss"])
)
# Will set to Ig_baseline here, but will be updated in TPI loop
# with call to fiscal.get_I_g
I_g = np.concatenate(
(Ig_baseline[: p.T], np.ones(p.S) * ss_vars["I_g_ss"])
)
# Will set to Gbaseline here, but will be updated in TPI loop
# with call to fiscal.D_G_path, which also does closure rule
G = np.concatenate(
(Gbaseline[: p.T], np.ones(p.S) * ss_vars["Gss"])
)
Expand Down
2 changes: 1 addition & 1 deletion ogcore/fiscal.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def D_G_path(r_gov, dg_fixed_values, p):
D[0] = D0_baseline

if p.baseline_spending:
G = Gbaseline[: p.T]
G = alpha_bs_G[:T] * Gbaseline[: p.T]
else:
G = p.alpha_G[: p.T] * Y[: p.T]

Expand Down

0 comments on commit 7b43966

Please sign in to comment.