ConsPrefShockModel#

Extensions to ConsIndShockModel concerning models with preference shocks. It currently only two models:

  1. An extension of ConsIndShock, but with an iid lognormal multiplicative shock each period.

  2. A combination of (1) and ConsKinkedR, demonstrating how to construct a new model by inheriting from multiple classes.

class HARK.ConsumptionSaving.ConsPrefShockModel.KinkyPrefConsumerType(**kwds)#

Bases: PrefShockConsumerType, KinkedRconsumerType

A class for representing consumers who experience multiplicative shocks to utility each period, specified as iid lognormal and different interest rates on borrowing vs saving.

See init_kinky_pref for a dictionary of the keywords that should be passed to the constructor.

get_Rfree()#

Returns an array of size self.AgentCount with self.Rfree in every entry.

Parameters:

None

Returns:

RfreeNow – Array of size self.AgentCount with risk free interest rate for each agent.

Return type:

np.array

pre_solve()#

Method that is run automatically just before solution by backward iteration. Solves the (trivial) terminal period and does a quick check on the borrowing constraint and MaxKinks attribute (only relevant in constrained, infinite horizon problems).

class HARK.ConsumptionSaving.ConsPrefShockModel.PrefShockConsumerType(**kwds)#

Bases: IndShockConsumerType

A class for representing consumers who experience multiplicative shocks to utility each period, specified as iid lognormal.

See ConsumerParameters.init_pref_shock for a dictionary of the keywords that should be passed to the constructor.

calc_bounding_values()#

Calculate human wealth plus minimum and maximum MPC in an infinite horizon model with only one period repeated indefinitely. Store results as attributes of self. Human wealth is the present discounted value of expected future income after receiving income this period, ignoring mort- ality. The maximum MPC is the limit of the MPC as m –> mNrmMin. The minimum MPC is the limit of the MPC as m –> infty.

NOT YET IMPLEMENTED FOR THIS CLASS

Parameters:

None

Return type:

None

get_controls()#

Calculates consumption for each consumer of this type using the consumption functions.

Parameters:

None

Return type:

None

get_shocks()#

Gets permanent and transitory income shocks for this period as well as preference shocks.

Parameters:

None

Return type:

None

make_euler_error_func(mMax=100, approx_inc_dstn=True)#

Creates a “normalized Euler error” function for this instance, mapping from market resources to “consumption error per dollar of consumption.” Stores result in attribute eulerErrorFunc as an interpolated function. Has option to use approximate income distribution stored in self.IncShkDstn or to use a (temporary) very dense approximation.

NOT YET IMPLEMENTED FOR THIS CLASS

Parameters:
  • mMax (float) – Maximum normalized market resources for the Euler error function.

  • approx_inc_dstn (Boolean) – Indicator for whether to use the approximate discrete income distri- bution stored in self.IncShkDstn[0], or to use a very accurate discrete approximation instead. When True, uses approximation in IncShkDstn; when False, makes and uses a very dense approximation.

Return type:

None

Notes

This method is not used by any other code in the library. Rather, it is here for expository and benchmarking purposes.

pre_solve()#

Method that is run automatically just before solution by backward iteration. Solves the (trivial) terminal period and does a quick check on the borrowing constraint and MaxKinks attribute (only relevant in constrained, infinite horizon problems).

reset_rng()#

Reset the RNG behavior of this type. This method is called automatically by initialize_sim(), ensuring that each simulation run uses the same sequence of random shocks; this is necessary for structural estimation to work. This method extends IndShockConsumerType.reset_rng() to also reset elements of PrefShkDstn.

Parameters:

None

Return type:

None

shock_vars_ = ['PermShk', 'TranShk', 'PrefShk']#
update()#

Updates the assets grid, income process, terminal period solution, and preference shock process. A very slight extension of IndShockConsumerType.update() for the preference shock model.

Parameters:

None

Return type:

None

update_pref_shock_process()#

Make a discrete preference shock structure for each period in the cycle for this agent type, storing them as attributes of self for use in the solution (and other methods).

Parameters:

none

Return type:

none