コード例 #1
0
ファイル: ConsAggShockModel.py プロジェクト: mnwhite/HARK
 def simBirth(self,which_agents):
     '''
     Makes new consumers for the given indices.  Initialized variables include aNrm and pLvl, as
     well as time variables t_age and t_cycle.  Normalized assets and permanent income levels
     are drawn from lognormal distributions given by aNrmInitMean and aNrmInitStd (etc).
     
     Parameters
     ----------
     which_agents : np.array(Bool)
         Boolean array of size self.AgentCount indicating which agents should be "born".
     
     Returns
     -------
     None
     '''
     IndShockConsumerType.simBirth(self,which_agents)
     if hasattr(self,'aLvlNow'):
         self.aLvlNow[which_agents] = self.aNrmNow[which_agents]*self.pLvlNow[which_agents]
     else:
         self.aLvlNow = self.aNrmNow*self.pLvlNow
コード例 #2
0
 def simBirth(self, which_agents):
     '''
     Makes new consumers for the given indices.  Initialized variables include aNrm and pLvl, as
     well as time variables t_age and t_cycle.  Normalized assets and permanent income levels
     are drawn from lognormal distributions given by aNrmInitMean and aNrmInitStd (etc).
     
     Parameters
     ----------
     which_agents : np.array(Bool)
         Boolean array of size self.AgentCount indicating which agents should be "born".
     
     Returns
     -------
     None
     '''
     IndShockConsumerType.simBirth(self, which_agents)
     if hasattr(self, 'aLvlNow'):
         self.aLvlNow[which_agents] = self.aNrmNow[
             which_agents] * self.pLvlNow[which_agents]
     else:
         self.aLvlNow = self.aNrmNow * self.pLvlNow