コード例 #1
0
 def getShocks(self):
     '''
     Finds the effective permanent and transitory shocks this period by combining the aggregate
     and idiosyncratic shocks of each type.
     
     Parameters
     ----------
     None
     
     Returns
     -------
     None
     '''
     IndShockConsumerType.getShocks(self)  # Update idiosyncratic shocks
     self.TranShkNow = self.TranShkNow * self.TranShkAggNow * self.wRteNow
     self.PermShkNow = self.PermShkNow * self.PermShkAggNow
コード例 #2
0
ファイル: ConsAggShockModel.py プロジェクト: mnwhite/HARK
 def getShocks(self):
     '''
     Finds the effective permanent and transitory shocks this period by combining the aggregate
     and idiosyncratic shocks of each type.
     
     Parameters
     ----------
     None
     
     Returns
     -------
     None
     '''
     IndShockConsumerType.getShocks(self) # Update idiosyncratic shocks
     self.TranShkNow = self.TranShkNow*self.TranShkAggNow*self.wRteNow
     self.PermShkNow = self.PermShkNow*self.PermShkAggNow
コード例 #3
0
ファイル: ConsPrefShockModel.py プロジェクト: mnwhite/HARK
 def getShocks(self):
     '''
     Gets permanent and transitory income shocks for this period as well as preference shocks.
     
     Parameters
     ----------
     None
     
     Returns
     -------
     None
     '''
     IndShockConsumerType.getShocks(self) # Get permanent and transitory income shocks
     PrefShkNow = np.zeros(self.AgentCount) # Initialize shock array
     for t in range(self.T_cycle):
         these = t == self.t_cycle
         N = np.sum(these)
         if N > 0:
             PrefShkNow[these] = self.RNG.permutation(approxMeanOneLognormal(N,sigma=self.PrefShkStd[t])[1])
     self.PrefShkNow = PrefShkNow
コード例 #4
0
 def getShocks(self):
     '''
     Gets permanent and transitory income shocks for this period as well as preference shocks.
     
     Parameters
     ----------
     None
     
     Returns
     -------
     None
     '''
     IndShockConsumerType.getShocks(self) # Get permanent and transitory income shocks
     PrefShkNow = np.zeros(self.AgentCount) # Initialize shock array
     for t in range(self.T_cycle):
         these = t == self.t_cycle
         N = np.sum(these)
         if N > 0:
             PrefShkNow[these] = self.RNG.permutation(approxMeanOneLognormal(N,sigma=self.PrefShkStd[t])[1])
     self.PrefShkNow = PrefShkNow