From c6987fcf6238ccc6a16c71352f6a0443bc9932c5 Mon Sep 17 00:00:00 2001 From: sb Date: Thu, 16 Apr 2020 14:01:01 -0400 Subject: [PATCH] updates to cstwMPC for 0.10.6 --- HARK/cstwMPC/cstwMPC.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/HARK/cstwMPC/cstwMPC.py b/HARK/cstwMPC/cstwMPC.py index d975ae9c3..604246897 100644 --- a/HARK/cstwMPC/cstwMPC.py +++ b/HARK/cstwMPC/cstwMPC.py @@ -12,9 +12,8 @@ import numpy as np from copy import copy, deepcopy from time import time -from HARK.utilities import approxMeanOneLognormal, combineIndepDstns, approxUniform, \ - getPercentiles, getLorenzShares, calcSubpopAvg, approxLognormal -from HARK.simulation import drawDiscrete +from HARK.distribution import approxMeanOneLognormal, combineIndepDstns, approxUniform, approxLognormal, DiscreteDistribution +from HARK.utilities import getPercentiles, getLorenzShares, calcSubpopAvg from HARK import Market import HARK.cstwMPC.SetupParamsCSTW as Params import HARK.ConsumptionSaving.ConsIndShockModel as Model @@ -63,8 +62,8 @@ def updateIncomeProcess(self): if self.cycles == 0: tax_rate = (self.IncUnemp*self.UnempPrb)/((1.0-self.UnempPrb)*self.IndL) TranShkDstn = deepcopy(approxMeanOneLognormal(self.TranShkCount,sigma=self.TranShkStd[0],tail_N=0)) - TranShkDstn[0] = np.insert(TranShkDstn[0]*(1.0-self.UnempPrb),0,self.UnempPrb) - TranShkDstn[1] = np.insert(TranShkDstn[1]*(1.0-tax_rate)*self.IndL,0,self.IncUnemp) + TranShkDstn.pmf = np.insert(TranShkDstn.pmf*(1.0-self.UnempPrb),0,self.UnempPrb) + TranShkDstn.X = np.insert(TranShkDstn.X*(1.0-tax_rate)*self.IndL,0,self.IncUnemp) PermShkDstn = approxMeanOneLognormal(self.PermShkCount,sigma=self.PermShkStd[0],tail_N=0) self.IncomeDstn = [combineIndepDstns(PermShkDstn,TranShkDstn)] self.TranShkDstn = TranShkDstn