Skip to content

Commit

Permalink
Merge pull request #854 from jdebacker/time_r_scale
Browse files Browse the repository at this point in the history
Merging
rickecon authored Feb 14, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents f4d3aaa + 784e02e commit eaac5eb
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion ogcore/SS.py
Original file line number Diff line number Diff line change
@@ -1237,10 +1237,17 @@ def run_SS(p, client=None):
if p.reform_use_baseline_solution:
# use baseline solution as starting values if dimensions match
try:
print(
"Shape HH = ",
ss_solutions["bssmat_splus1"].shape,
p.S,
p.J,
)
print("Shape firm = ", ss_solutions["Y_vec_ss"].shape, p.M)
if ss_solutions["bssmat_splus1"].shape == (
p.S,
p.J,
) and ss_solutions["Y_vec_ss"].shape == (p.M):
) and np.squeeze(ss_solutions["Y_vec_ss"].shape) == (p.M):
print("Using previous solutions for SS")
(
b_guess,
@@ -1269,10 +1276,15 @@ def run_SS(p, client=None):
)
use_new_guesses = False
else:
print(
"Dimensions of previous solutions for SS do not match"
)
use_new_guesses = True
except KeyError:
print("KeyError: previous solutions for SS not found")
use_new_guesses = True
else:
print("Using new guesses for SS")
use_new_guesses = True
if use_new_guesses:
if p.use_zeta:
4 changes: 2 additions & 2 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ def test_constant_demographics_TPI(tmpdir, dask_client):
"budget_balance": True,
"zero_taxes": True,
"maxiter": 2,
"r_gov_shift": 0.0,
"r_gov_shift": [0.0],
"zeta_D": [0.0, 0.0],
"zeta_K": [0.0, 0.0],
"debt_ratio_ss": 1.0,
@@ -125,7 +125,7 @@ def test_constant_demographics_TPI_small_open(tmpdir, dask_client):
"budget_balance": True,
"zero_taxes": True,
"maxiter": 2,
"r_gov_shift": 0.0,
"r_gov_shift": [0.0],
"zeta_D": [0.0, 0.0],
"zeta_K": [1.0],
"debt_ratio_ss": 1.0,

0 comments on commit eaac5eb

Please sign in to comment.