コード例 #1
0
ファイル: cstwMPC.py プロジェクト: ganong123/HARK
 def update(self):
     '''
     Update the income process, the assets grid, and the terminal solution.
     
     Parameters
     ----------
     none
         
     Returns
     -------
     none
     '''
     orig_flow = self.time_flow        
     if self.cycles == 0: # hacky fix for labor supply l_bar
         self.updateIncomeProcessAlt()
     else:
         self.updateIncomeProcess()
     self.updateAssetsGrid()
     self.updateSolutionTerminal()
     self.timeFwd()
     self.resetRNG()
     if self.cycles > 0:
         self.IncomeDstn = Model.applyFlatIncomeTax(self.IncomeDstn,
                                              tax_rate=self.tax_rate,
                                              T_retire=self.T_retire,
                                              unemployed_indices=range(0,(self.TranShkCount+1)*
                                              self.PermShkCount,self.TranShkCount+1))          
     self.makeIncShkHist()
     if not orig_flow:
         self.timeRev()
コード例 #2
0
ファイル: cstwMPC.py プロジェクト: victojensen/cstwMPC
 def update(self):
     '''
     Update the income process and the assets grid.
     '''
     orig_flow = self.time_flow
     self.updateIncomeProcess()
     self.updateAssetsGrid()
     if self.cycles > 0:
         self.income_distrib = Model.applyFlatIncomeTax(
             self.income_distrib,
             tax_rate=self.tax_rate,
             T_retire=self.T_retire,
             unemployed_indices=range(0, (self.xi_N + 1) * self.psi_N,
                                      self.xi_N + 1))
         scriptR_shocks, xi_shocks = Model.generateIncomeShockHistoryLognormalUnemployment(
             self)
         self.addIncomeShockPaths(scriptR_shocks, xi_shocks)
     else:
         self.timeRev()
         scriptR_shocks, xi_shocks = Model.generateIncomeShockHistoryInfiniteSimple(
             self)
         self.addIncomeShockPaths(scriptR_shocks, xi_shocks)
     if orig_flow:
         self.timeFwd()
コード例 #3
0
ファイル: cstwMPC.py プロジェクト: akaufman10/HARK
 def update(self):
     '''
     Update the income process and the assets grid.
     '''
     orig_flow = self.time_flow        
     if self.cycles == 0: # hacky fix for labor supply l_bar
         self.updateIncomeProcessAlt()
     else:
         self.updateIncomeProcess()
     self.updateAssetsGrid()
     self.updateSolutionTerminal()
     self.timeFwd()
     if self.cycles > 0:
         self.income_distrib = Model.applyFlatIncomeTax(self.income_distrib,
                                              tax_rate=self.tax_rate,
                                              T_retire=self.T_retire,
                                              unemployed_indices=range(0,(self.xi_N+1)*self.psi_N,self.xi_N+1))
         scriptR_shocks, xi_shocks = Model.generateIncomeShockHistoryLognormalUnemployment(self)    
         self.addIncomeShockPaths(scriptR_shocks,xi_shocks)   
     else:
         scriptR_shocks, xi_shocks = Model.generateIncomeShockHistoryInfiniteSimple(self)
         self.addIncomeShockPaths(scriptR_shocks,xi_shocks)
     if not orig_flow:
         self.timeRev()