ConsIndShockModelFast#

Classes to solve canonical consumption-savings models with idiosyncratic shocks to income. All models here assume CRRA utility with geometric discounting, no bequest motive, and income shocks are fully transitory or fully permanent.

It currently solves three types of models:
  1. A very basic “perfect foresight” consumption-savings model with no uncertainty.

  2. A consumption-savings model with risk over transitory and permanent income shocks.

  3. The model described in (2), with an interest rate for debt that differs from the interest rate for savings. #todo

See NARK econ-ark/HARK for information on variable naming conventions. See HARK documentation for mathematical descriptions of the models being solved.

class HARK.ConsumptionSaving.ConsIndShockModelFast.PerfForesightSolution(mNrm=array([0., 1.]), cNrm=array([0., 1.]), vFuncNvrsSlope=0.0, mNrmMin=0.0, hNrm=0.0, MPCmin=1.0, MPCmax=1.0)#

Bases: MetricObject

A class representing the solution of a single period of a consumption-saving perfect foresight problem.

Here and elsewhere in the code, Nrm indicates that variables are normalized by permanent income.

Parameters:
  • mNrm (np.array) – (Normalized) corresponding market resource points for interpolation.

  • cNrm (np.array) – (Normalized) consumption points for interpolation.

  • vFuncNvrsSlope (float) – Constant slope of inverse value vFuncNvrs

  • mNrmMin (float) – The minimum allowable market resources for this period; the consump- tion function (etc) are undefined for m < mNrmMin.

  • hNrm (float) – Human wealth after receiving income this period: PDV of all future income, ignoring mortality.

  • MPCmin (float) – Infimum of the marginal propensity to consume this period. MPC –> MPCmin as m –> infinity.

  • MPCmax (float) – Supremum of the marginal propensity to consume this period. MPC –> MPCmax as m –> mNrmMin.

distance_criteria = ['cNrm', 'mNrm']#
class HARK.ConsumptionSaving.ConsIndShockModelFast.IndShockSolution(mNrm=array([0., 0.02040816, 0.04081633, 0.06122449, 0.08163265, 0.10204082, 0.12244898, 0.14285714, 0.16326531, 0.18367347, 0.20408163, 0.2244898, 0.24489796, 0.26530612, 0.28571429, 0.30612245, 0.32653061, 0.34693878, 0.36734694, 0.3877551, 0.40816327, 0.42857143, 0.44897959, 0.46938776, 0.48979592, 0.51020408, 0.53061224, 0.55102041, 0.57142857, 0.59183673, 0.6122449, 0.63265306, 0.65306122, 0.67346939, 0.69387755, 0.71428571, 0.73469388, 0.75510204, 0.7755102, 0.79591837, 0.81632653, 0.83673469, 0.85714286, 0.87755102, 0.89795918, 0.91836735, 0.93877551, 0.95918367, 0.97959184, 1.]), cNrm=array([0., 0.02040816, 0.04081633, 0.06122449, 0.08163265, 0.10204082, 0.12244898, 0.14285714, 0.16326531, 0.18367347, 0.20408163, 0.2244898, 0.24489796, 0.26530612, 0.28571429, 0.30612245, 0.32653061, 0.34693878, 0.36734694, 0.3877551, 0.40816327, 0.42857143, 0.44897959, 0.46938776, 0.48979592, 0.51020408, 0.53061224, 0.55102041, 0.57142857, 0.59183673, 0.6122449, 0.63265306, 0.65306122, 0.67346939, 0.69387755, 0.71428571, 0.73469388, 0.75510204, 0.7755102, 0.79591837, 0.81632653, 0.83673469, 0.85714286, 0.87755102, 0.89795918, 0.91836735, 0.93877551, 0.95918367, 0.97959184, 1.]), cFuncLimitIntercept=None, cFuncLimitSlope=None, mNrmMin=0.0, hNrm=0.0, MPCmin=1.0, MPCmax=1.0, Ex_IncNext=0.0, MPC=None, mNrmGrid=None, vNvrs=None, vNvrsP=None, MPCminNvrs=None)#

Bases: MetricObject

A class representing the solution of a single period of a consumption-saving idiosyncratic shocks to permanent and transitory income problem.

Parameters:
  • mNrm (np.array) – (Normalized) corresponding market resource points for interpolation.

  • cNrm (np.array) – (Normalized) consumption points for interpolation.

  • vFuncNvrsSlope (float) – Constant slope of inverse value vFuncNvrs

  • mNrmMin (float) – The minimum allowable market resources for this period; the consump- tion function (etc) are undefined for m < mNrmMin.

  • hNrm (float) – Human wealth after receiving income this period: PDV of all future income, ignoring mortality.

  • MPCmin (float) – Infimum of the marginal propensity to consume this period. MPC –> MPCmin as m –> infinity.

  • MPCmax (float) – Supremum of the marginal propensity to consume this period. MPC –> MPCmax as m –> mNrmMin.

distance_criteria = ['cNrm', 'mNrm', 'mNrmMin']#
class HARK.ConsumptionSaving.ConsIndShockModelFast.PerfForesightConsumerTypeFast(solution_terminal=None, pseudo_terminal=True, tolerance=1e-06, verbose=1, quiet=False, seed=0, construct=True, **kwds)#

Bases: PerfForesightConsumerType

A version of the perfect foresight consumer type speed up by numba.

solution_terminal_class#

alias of PerfForesightSolution

default_ = {'params': {'AgentCount': 10000, 'BoroCnstArt': None, 'CRRA': 2.0, 'DiscFac': 0.96, 'LivPrb': [0.98], 'MaxKinks': 400, 'PerfMITShk': False, 'PermGroFac': [1.01], 'PermGroFacAgg': 1.0, 'Rfree': [1.03], 'T_age': None, 'T_cycle': 1, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'constructors': {'solution_terminal': <function make_solution_terminal_fast>}, 'cycles': 1, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.0, 'pseudo_terminal': False}, 'solver': <function make_one_period_oo_solver.<locals>.one_period_solver>}#
post_solve()#

Method that is run automatically at the end of a call to solve. Here, it simply calls calc_stable_points() if appropriate: an infinite horizon problem with a single repeated period in its cycle.

Parameters:

None

Return type:

None

class HARK.ConsumptionSaving.ConsIndShockModelFast.IndShockConsumerTypeFast(solution_terminal=None, pseudo_terminal=True, tolerance=1e-06, verbose=1, quiet=False, seed=0, construct=True, **kwds)#

Bases: IndShockConsumerType, PerfForesightConsumerTypeFast

A version of the idiosyncratic shock consumer type sped up by numba.

If CubicBool and vFuncBool are both set to false it’s further optimized.

solution_terminal_class#

alias of IndShockSolution

default_ = {'params': {'AgentCount': 10000, 'BoroCnstArt': 0.0, 'CRRA': 2.0, 'CubicBool': False, 'DiscFac': 0.96, 'IncUnemp': 0.3, 'IncUnempRet': 0.0, 'LivPrb': [0.98], 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFac': [1.01], 'PermGroFacAgg': 1.0, 'PermShkCount': 7, 'PermShkStd': [0.1], 'Rfree': [1.03], 'T_age': None, 'T_cycle': 1, 'T_retire': 0, 'TranShkCount': 7, 'TranShkStd': [0.1], 'UnempPrb': 0.05, 'UnempPrbRet': 0.005, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'aXtraCount': 48, 'aXtraExtra': None, 'aXtraMax': 20, 'aXtraMin': 0.001, 'aXtraNestFac': 3, 'constructors': {'IncShkDstn': <function construct_lognormal_income_process_unemployment>, 'PermShkDstn': <function get_PermShkDstn_from_IncShkDstn>, 'TranShkDstn': <function get_TranShkDstn_from_IncShkDstn>, 'aXtraGrid': <function make_assets_grid>, 'solution_terminal': <function make_solution_terminal_fast>, 'solve_one_period': <function select_fast_solver>}, 'cycles': 1, 'neutral_measure': False, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.0, 'pseudo_terminal': False, 'vFuncBool': False}, 'solver': <HARK.utilities.NullFunc object>}#
post_solve()#

Method that is run automatically at the end of a call to solve. Here, it simply calls calc_stable_points() if appropriate: an infinite horizon problem with a single repeated period in its cycle.

Parameters:

None

Return type:

None