From 215609467b5af352273f3b2731e4c7e5bb62ce61 Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 13 Jan 2021 15:43:21 -0500 Subject: [PATCH] save and store m_nrm_next function see #625 --- HARK/ConsumptionSaving/ConsIndShockModel.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/HARK/ConsumptionSaving/ConsIndShockModel.py b/HARK/ConsumptionSaving/ConsIndShockModel.py index 6c97c1819..8d147774d 100644 --- a/HARK/ConsumptionSaving/ConsIndShockModel.py +++ b/HARK/ConsumptionSaving/ConsIndShockModel.py @@ -752,6 +752,12 @@ def prepareToCalcEndOfPrdvP(self): + TranShkVals_temp ) # CDC 20191205: This should be divided by LivPrb[0] for Blanchard insurance + # use this to replace mNrmNext, which is too big... + def m_nrm_next(shocks, a_nrm): + return self.Rfree / (self.PermGroFac * shocks[0]) \ + * a_nrm + shocks[1] + self.m_nrm_next = m_nrm_next + # Store and report the results self.PermShkVals_temp = PermShkVals_temp self.ShkPrbs_temp = ShkPrbs_temp @@ -778,9 +784,7 @@ def calcEndOfPrdvP(self): def vp_next(shocks, a_nrm): return shocks[0] ** (-self.CRRA) \ - * self.vPfuncNext( - self.Rfree / (self.PermGroFac * shocks[0]) * a_nrm + shocks[1] - ) + * self.vPfuncNext(self.m_nrm_next(shocks, a_nrm)) EndOfPrdvP = ( self.DiscFacEff @@ -979,7 +983,7 @@ def makeCubiccFunc(self, mNrm, cNrm): """ 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]) + * self.vPPfuncNext(self.m_nrm_next(shocks, a_nrm)) EndOfPrdvPP = ( self.DiscFacEff