From 1c9129aa48e5859bb486126532042666193909de Mon Sep 17 00:00:00 2001 From: sb Date: Sat, 26 Dec 2020 16:11:53 -0500 Subject: [PATCH] compute expected income in ConsIndShockModel with calcExpectations, see #625 --- HARK/ConsumptionSaving/ConsIndShockModel.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/HARK/ConsumptionSaving/ConsIndShockModel.py b/HARK/ConsumptionSaving/ConsIndShockModel.py index 00422f46f..58b08174c 100644 --- a/HARK/ConsumptionSaving/ConsIndShockModel.py +++ b/HARK/ConsumptionSaving/ConsIndShockModel.py @@ -26,6 +26,7 @@ from HARK.distribution import ( DiscreteDistribution, addDiscreteOutcomeConstantMean, + calcExpectation, combineIndepDstns, ) from HARK.utilities import ( @@ -2824,7 +2825,10 @@ def calcBoundingValues(self): PermShkValsNext = self.IncomeDstn[0][1] TranShkValsNext = self.IncomeDstn[0][2] ShkPrbsNext = self.IncomeDstn[0][0] - ExIncNext = np.dot(ShkPrbsNext, PermShkValsNext * TranShkValsNext) + ExIncNext = calcExpectation( + IncomeDstn, + lambda trans, perm : trans * perm + ) PermShkMinNext = np.min(PermShkValsNext) TranShkMinNext = np.min(TranShkValsNext) WorstIncNext = PermShkMinNext * TranShkMinNext