Skip to content

Commit

Permalink
use calcExpectation in vPP calculation in MarkovModel. econ-ark#625
Browse files Browse the repository at this point in the history
  • Loading branch information
sbenthall committed Jan 13, 2021
1 parent 6e5e38f commit 99a1633
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions HARK/ConsumptionSaving/ConsMarkovModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
PerfForesightConsumerType,
)

from HARK.distribution import DiscreteDistribution, Uniform
from HARK.distribution import (
DiscreteDistribution,
Uniform,
calcExpectation
)
from HARK.interpolation import (
CubicInterp,
LowerEnvelope,
Expand Down Expand Up @@ -321,16 +325,19 @@ def calcEndOfPrdvPP(self):
End-of-period marginal marginal value of assets at each value in
the grid of assets.
"""
def vpp_next(shocks, a_nrm):
return shocks[0] ** (- self.CRRA - 1.0) \
* self.vPPfuncNext(self.m_nrm_next(shocks, a_nrm))

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
)
)
return EndOfPrdvPP
Expand Down

0 comments on commit 99a1633

Please sign in to comment.