From e18b9b03e17f2965e0382879cb5422e160bfb5f8 Mon Sep 17 00:00:00 2001 From: "Matthew N. White" Date: Fri, 6 Jul 2018 19:27:27 -0400 Subject: [PATCH] Add MPC to simulation in ConsGenIncProcessModel 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. --- HARK/ConsumptionSaving/ConsGenIncProcessModel.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/HARK/ConsumptionSaving/ConsGenIncProcessModel.py b/HARK/ConsumptionSaving/ConsGenIncProcessModel.py index df40e2c2a..99073f7cf 100644 --- a/HARK/ConsumptionSaving/ConsGenIncProcessModel.py +++ b/HARK/ConsumptionSaving/ConsGenIncProcessModel.py @@ -1166,10 +1166,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):