Skip to content

Commit

Permalink
save and store m_nrm_next function see econ-ark#625
Browse files Browse the repository at this point in the history
  • Loading branch information
sbenthall committed Jan 13, 2021
1 parent 190b8b2 commit 2156094
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions HARK/ConsumptionSaving/ConsIndShockModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2156094

Please sign in to comment.