From 190b8b2f32ecff15b08e3fd2f07d1ee8238bbefb Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 13 Jan 2021 15:30:34 -0500 Subject: [PATCH] use calcExpectations for EndOfPrdvPP in IndShock type. See #625 --- HARK/ConsumptionSaving/ConsIndShockModel.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/HARK/ConsumptionSaving/ConsIndShockModel.py b/HARK/ConsumptionSaving/ConsIndShockModel.py index 806552ce2..6c97c1819 100644 --- a/HARK/ConsumptionSaving/ConsIndShockModel.py +++ b/HARK/ConsumptionSaving/ConsIndShockModel.py @@ -977,16 +977,19 @@ def makeCubiccFunc(self, mNrm, cNrm): cFuncUnc : CubicInterp The unconstrained consumption function for this period. """ + def vpp_next(shocks, a_nrm): + return shocks[0] ** (- self.CRRA - 1.0) \ + * self.vPPfuncNext(self.Rfree / (self.PermGroFac * shocks[0]) * a_nrm + shocks[1]) + EndOfPrdvPP = ( self.DiscFacEff * self.Rfree * self.Rfree * self.PermGroFac ** (-self.CRRA - 1.0) - * np.sum( - self.PermShkVals_temp ** (-self.CRRA - 1.0) - * self.vPPfuncNext(self.mNrmNext) - * self.ShkPrbs_temp, - axis=0, + * calcExpectation( + self.IncomeDstn, + vpp_next, + self.aNrmNow ) ) dcda = EndOfPrdvPP / self.uPP(np.array(cNrm[1:]))