Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions HARK/ConsumptionSaving/ConsIndShockModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def solve_one_period_ConsPF(
return solution_now


def calc_worst_inc_prob(inc_shk_dstn, use_infimum=True):
def calc_worst_inc_prob(inc_shk_dstn, use_infimum=False):
"""Calculate the probability of the worst income shock.

Args:
Expand All @@ -478,7 +478,7 @@ def calc_worst_inc_prob(inc_shk_dstn, use_infimum=True):


def calc_boro_const_nat(
m_nrm_min_next, inc_shk_dstn, rfree, perm_gro_fac, use_infimum=True
m_nrm_min_next, inc_shk_dstn, rfree, perm_gro_fac, use_infimum=False
):
"""Calculate the natural borrowing constraint.

Expand Down
4 changes: 2 additions & 2 deletions tests/ConsumptionSaving/test_ConsNewKeynesianModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_calc_tran_matrix(self):
AggC = np.dot(gridc.flatten(), vecDstn) # Aggregate Consumption
AggA = np.dot(grida.flatten(), vecDstn) # Aggregate Assets

self.assertAlmostEqual(AggA[0], 0.82960, places=4)
self.assertAlmostEqual(AggA[0], 0.82983, places=4)
self.assertAlmostEqual(AggC[0], 1.00780, places=4)


Expand All @@ -52,6 +52,6 @@ def test_calc_jacobian(self):
Agent.compute_steady_state()
CJAC_Perm, AJAC_Perm = Agent.calc_jacobian("PermShkStd", 50)

self.assertAlmostEqual(CJAC_Perm.T[30][29], -0.10508, places=HARK_PRECISION)
self.assertAlmostEqual(CJAC_Perm.T[30][29], -0.10503, places=HARK_PRECISION)
self.assertAlmostEqual(CJAC_Perm.T[30][30], 0.10316, places=HARK_PRECISION)
self.assertAlmostEqual(CJAC_Perm.T[30][31], 0.09059, places=HARK_PRECISION)
14 changes: 7 additions & 7 deletions tests/ConsumptionSaving/test_IndShockConsumerType.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ def test_ConsIndShockSolverBasic(self):

self.assertAlmostEqual(
LifecycleExample.solution[0].cFunc(1).tolist(),
0.75074,
0.75062,
places=HARK_PRECISION,
)
self.assertAlmostEqual(
LifecycleExample.solution[1].cFunc(1).tolist(),
0.75876,
0.75863,
places=HARK_PRECISION,
)
self.assertAlmostEqual(
LifecycleExample.solution[2].cFunc(1).tolist(),
0.76824,
0.76812,
places=HARK_PRECISION,
)

Expand Down Expand Up @@ -227,7 +227,7 @@ def test_infinite_horizon(self):
IndShockExample.solve()

self.assertAlmostEqual(
IndShockExample.solution[0].mNrmStE, 1.54765, places=HARK_PRECISION
IndShockExample.solution[0].mNrmStE, 1.54882, places=HARK_PRECISION
)
# self.assertAlmostEqual(
# IndShockExample.solution[0].cFunc.functions[0].x_list[0],
Expand Down Expand Up @@ -311,7 +311,7 @@ def test_lifecyle(self):

self.assertAlmostEqual(
LifecycleExample.solution[5].cFunc(3).tolist(),
2.13004,
2.12998,
places=HARK_PRECISION,
)

Expand Down Expand Up @@ -385,15 +385,15 @@ def test_cyclical(self):

self.assertAlmostEqual(
CyclicalExample.solution[3].cFunc(3).tolist(),
1.59597,
1.59584,
places=HARK_PRECISION,
)

CyclicalExample.initialize_sim()
CyclicalExample.simulate()

self.assertAlmostEqual(
CyclicalExample.state_now["aLvl"][1], 3.8924, places=HARK_PRECISION
CyclicalExample.state_now["aLvl"][1], 3.90015, places=HARK_PRECISION
)


Expand Down
2 changes: 1 addition & 1 deletion tests/ConsumptionSaving/test_modelcomparisons.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def setUp(self):
test_dictionary["UnempPrb"] = 0.0
test_dictionary["T_cycle"] = 1
test_dictionary["T_retire"] = 0
test_dictionary["BoroCnstArt"] = 0.0
test_dictionary["BoroCnstArt"] = None

InfiniteType = IndShockConsumerType(**test_dictionary)
InfiniteType.cycles = 0
Expand Down
Loading