diff --git a/HARK/ConsumptionSaving/ConsGenIncProcessModel.py b/HARK/ConsumptionSaving/ConsGenIncProcessModel.py index 748e0b1fd..d35f52152 100644 --- a/HARK/ConsumptionSaving/ConsGenIncProcessModel.py +++ b/HARK/ConsumptionSaving/ConsGenIncProcessModel.py @@ -18,6 +18,7 @@ getPercentiles from HARK.simulation import drawLognormal, drawDiscrete, drawUniform from HARK.ConsumptionSaving.ConsIndShockModel import ConsIndShockSetup, ConsumerSolution, IndShockConsumerType +import HARK.ConsumptionSaving.ConsumerParameters as Params utility = CRRAutility utilityP = CRRAutilityP @@ -982,6 +983,10 @@ def __init__(self, cycles=1, time_flow=True, **kwds): ------- None ''' + params = Params.init_explicit_perm_inc.copy() + params.update(kwds) + kwds = params + # Initialize a basic ConsumerType IndShockConsumerType.__init__(self, cycles=cycles, time_flow=time_flow, **kwds) self.solveOnePeriod = solveConsGenIncProcess # idiosyncratic shocks solver with explicit persistent income @@ -1310,7 +1315,6 @@ def updatepLvlNextFunc(self): ############################################################################### def main(): - import HARK.ConsumptionSaving.ConsumerParameters as Params from HARK.utilities import plotFuncs from time import clock import matplotlib.pyplot as plt @@ -1326,7 +1330,7 @@ def mystr(number): return "{:.4f}".format(number) print('percentile is ' + str(Params.init_explicit_perm_inc['pLvlPctiles'][-1]*100) + '.\n') # Make and solve an example "explicit permanent income" consumer with idiosyncratic shocks - ExplicitExample = IndShockExplicitPermIncConsumerType(**Params.init_explicit_perm_inc) + ExplicitExample = IndShockExplicitPermIncConsumerType() t_start = clock() ExplicitExample.solve() t_end = clock() diff --git a/HARK/ConsumptionSaving/ConsMedModel.py b/HARK/ConsumptionSaving/ConsMedModel.py index 75b2502ad..ca1ebedbe 100644 --- a/HARK/ConsumptionSaving/ConsMedModel.py +++ b/HARK/ConsumptionSaving/ConsMedModel.py @@ -18,6 +18,7 @@ from HARK.ConsumptionSaving.ConsGenIncProcessModel import ConsGenIncProcessSolver,\ PersistentShockConsumerType, ValueFunc2D, MargValueFunc2D,\ MargMargValueFunc2D, VariableLowerBoundFunc2D +import HARK.ConsumptionSaving.ConsumerParameters as Params from copy import deepcopy utility_inv = CRRAutility_inv @@ -527,6 +528,10 @@ def __init__(self,cycles=1,time_flow=True,**kwds): ------- None ''' + params = Params.init_medical_shocks.copy() + params.update(kwds) + kwds = params + PersistentShockConsumerType.__init__(self,cycles=cycles,**kwds) self.solveOnePeriod = solveConsMedShock # Choose correct solver self.addToTimeInv('CRRAmed') @@ -1361,7 +1366,6 @@ def solveConsMedShock(solution_next,IncomeDstn,MedShkDstn,LivPrb,DiscFac,CRRA,CR ############################################################################### def main(): - import HARK.ConsumptionSaving.ConsumerParameters as Params from HARK.utilities import CRRAutility_inv from time import clock import matplotlib.pyplot as plt @@ -1370,7 +1374,7 @@ def main(): do_simulation = True # Make and solve an example medical shocks consumer type - MedicalExample = MedShockConsumerType(**Params.init_medical_shocks) + MedicalExample = MedShockConsumerType() t_start = clock() MedicalExample.solve() t_end = clock()