Skip to content

Commit a3051f0

Browse files
committed
Turn off use_infimum
This feature wasn't ready for primetime and is causing bad numeric behavior with vFuncBool. Test targets have been reverted.
1 parent a98e751 commit a3051f0

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

HARK/ConsumptionSaving/ConsIndShockModel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ def solve_one_period_ConsPF(
460460
return solution_now
461461

462462

463-
def calc_worst_inc_prob(inc_shk_dstn, use_infimum=True):
463+
def calc_worst_inc_prob(inc_shk_dstn, use_infimum=False):
464464
"""Calculate the probability of the worst income shock.
465465
466466
Args:
@@ -478,7 +478,7 @@ def calc_worst_inc_prob(inc_shk_dstn, use_infimum=True):
478478

479479

480480
def calc_boro_const_nat(
481-
m_nrm_min_next, inc_shk_dstn, rfree, perm_gro_fac, use_infimum=True
481+
m_nrm_min_next, inc_shk_dstn, rfree, perm_gro_fac, use_infimum=False
482482
):
483483
"""Calculate the natural borrowing constraint.
484484

tests/ConsumptionSaving/test_ConsNewKeynesianModel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_calc_tran_matrix(self):
3939
AggC = np.dot(gridc.flatten(), vecDstn) # Aggregate Consumption
4040
AggA = np.dot(grida.flatten(), vecDstn) # Aggregate Assets
4141

42-
self.assertAlmostEqual(AggA[0], 0.82960, places=4)
42+
self.assertAlmostEqual(AggA[0], 0.82983, places=4)
4343
self.assertAlmostEqual(AggC[0], 1.00780, places=4)
4444

4545

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

55-
self.assertAlmostEqual(CJAC_Perm.T[30][29], -0.10508, places=HARK_PRECISION)
55+
self.assertAlmostEqual(CJAC_Perm.T[30][29], -0.10503, places=HARK_PRECISION)
5656
self.assertAlmostEqual(CJAC_Perm.T[30][30], 0.10316, places=HARK_PRECISION)
5757
self.assertAlmostEqual(CJAC_Perm.T[30][31], 0.09059, places=HARK_PRECISION)

tests/ConsumptionSaving/test_IndShockConsumerType.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,17 @@ def test_ConsIndShockSolverBasic(self):
5050

5151
self.assertAlmostEqual(
5252
LifecycleExample.solution[0].cFunc(1).tolist(),
53-
0.75074,
53+
0.75062,
5454
places=HARK_PRECISION,
5555
)
5656
self.assertAlmostEqual(
5757
LifecycleExample.solution[1].cFunc(1).tolist(),
58-
0.75876,
58+
0.75863,
5959
places=HARK_PRECISION,
6060
)
6161
self.assertAlmostEqual(
6262
LifecycleExample.solution[2].cFunc(1).tolist(),
63-
0.76824,
63+
0.76812,
6464
places=HARK_PRECISION,
6565
)
6666

@@ -227,7 +227,7 @@ def test_infinite_horizon(self):
227227
IndShockExample.solve()
228228

229229
self.assertAlmostEqual(
230-
IndShockExample.solution[0].mNrmStE, 1.54765, places=HARK_PRECISION
230+
IndShockExample.solution[0].mNrmStE, 1.54882, places=HARK_PRECISION
231231
)
232232
# self.assertAlmostEqual(
233233
# IndShockExample.solution[0].cFunc.functions[0].x_list[0],
@@ -311,7 +311,7 @@ def test_lifecyle(self):
311311

312312
self.assertAlmostEqual(
313313
LifecycleExample.solution[5].cFunc(3).tolist(),
314-
2.13004,
314+
2.12998,
315315
places=HARK_PRECISION,
316316
)
317317

@@ -385,15 +385,15 @@ def test_cyclical(self):
385385

386386
self.assertAlmostEqual(
387387
CyclicalExample.solution[3].cFunc(3).tolist(),
388-
1.59597,
388+
1.59584,
389389
places=HARK_PRECISION,
390390
)
391391

392392
CyclicalExample.initialize_sim()
393393
CyclicalExample.simulate()
394394

395395
self.assertAlmostEqual(
396-
CyclicalExample.state_now["aLvl"][1], 3.8924, places=HARK_PRECISION
396+
CyclicalExample.state_now["aLvl"][1], 3.90015, places=HARK_PRECISION
397397
)
398398

399399

tests/ConsumptionSaving/test_modelcomparisons.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def setUp(self):
4747
test_dictionary["UnempPrb"] = 0.0
4848
test_dictionary["T_cycle"] = 1
4949
test_dictionary["T_retire"] = 0
50-
test_dictionary["BoroCnstArt"] = 0.0
50+
test_dictionary["BoroCnstArt"] = None
5151

5252
InfiniteType = IndShockConsumerType(**test_dictionary)
5353
InfiniteType.cycles = 0

0 commit comments

Comments
 (0)