Skip to content

Commit

Permalink
Add MPC to simulation in ConsGenIncProcessModel (#170)
Browse files Browse the repository at this point in the history
The MPC is calculated and stored as an attribute (MPCnow) in some models, but this was omitted in ConsGenIncProcessModel.  As it turns out, this functionality is necessary for an exercise/notebook that is being prepared for NBER SI.
  • Loading branch information
mnwhite authored and llorracc committed Feb 28, 2019
1 parent bd669a7 commit 7e690d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions HARK/ConsumptionSaving/ConsGenIncProcessModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1169,10 +1169,13 @@ def getControls(self):
None
'''
cLvlNow = np.zeros(self.AgentCount) + np.nan
MPCnow = np.zeros(self.AgentCount) + np.nan
for t in range(self.T_cycle):
these = t == self.t_cycle
cLvlNow[these] = self.solution[t].cFunc(self.mLvlNow[these],self.pLvlNow[these])
MPCnow[these] = self.solution[t].cFunc.derivativeX(self.mLvlNow[these],self.pLvlNow[these])
self.cLvlNow = cLvlNow
self.MPCnow = MPCnow


def getPostStates(self):
Expand Down

0 comments on commit 7e690d9

Please sign in to comment.