moving preference shock parameters
@@ -13,9 +13,19 @@ from builtins import range
import numpy as np
from HARK.utilities import approxMeanOneLognormal
from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType, ConsumerSolution, ConsIndShockSolver, \
- ValueFunc, MargValueFunc, KinkedRconsumerType, ConsKinkedRsolver
+ ValueFunc, MargValueFunc, KinkedRconsumerType, ConsKinkedRsolver, init_idiosyncratic_shocks, init_kinked_R
from HARK.interpolation import LinearInterpOnInterp1D, LinearInterp, CubicInterp, LowerEnvelope
-import HARK.ConsumptionSaving.ConsumerParameters as Params
+
+
+# Make a dictionary to specify a preference shock consumer
+init_preference_shocks = dict(init_idiosyncratic_shocks,
+ **{
+ 'PrefShkCount' : 12, # Number of points in discrete approximation to preference shock dist
+ 'PrefShk_tail_N'] : 4, # Number of "tail points" on each end of pref shock dist
+ 'PrefShkStd' : [0.30], # Standard deviation of utility shocks
+ 'aXtraCount' : 48,
+ 'CubicBool' : False # pref shocks currently only compatible with linear cFunc
+})
class PrefShockConsumerType(IndShockConsumerType):
'''
@@ -45,14 +55,13 @@ class PrefShockConsumerType(IndShockConsumerType):
-------
None
'''
- params = Params.init_preference_shocks.copy()
+ params = init_preference_shocks.copy()
params.update(kwds)
- kwds = params
IndShockConsumerType.__init__(self,
cycles=cycles,
time_flow=time_flow,
- **kwds)
+ **params)
self.solveOnePeriod = solveConsPrefShock # Choose correct solver
def preSolve(self):
@@ -193,6 +202,13 @@ class PrefShockConsumerType(IndShockConsumerType):
raise NotImplementedError()
+# Make a dictionary to specify a "kinky preference" consumer, who has both shocks
+# to utility and a different interest rate on borrowing vs saving
+init_kinky_pref = copy(init_kinked_R)
+init_kinky_pref['PrefShkCount'] = PrefShkCount
+init_kinky_pref['PrefShk_tail_N'] = PrefShk_tail_N
+init_kinky_pref['PrefShkStd'] = PrefShkStd
+
class KinkyPrefConsumerType(PrefShockConsumerType,KinkedRconsumerType):
'''
A class for representing consumers who experience multiplicative shocks to
