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 https://HARK.githhub.io/Documentation/NARK 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: HARK.core.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: HARK.core.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.ConsPerfForesightSolverFast(solution_next, DiscFac, LivPrb, CRRA, Rfree, PermGroFac, BoroCnstArt, MaxKinks)

Bases: HARK.ConsumptionSaving.ConsIndShockModel.ConsPerfForesightSolver

A class for solving a one period perfect foresight consumption-saving problem. An instance of this class is created by the function solvePerfForesight in each period.

solve()

Solves the one period perfect foresight consumption-saving problem.

Parameters:None
Returns:solution – The solution to this period’s problem.
Return type:PerfForesightSolution
class HARK.ConsumptionSaving.ConsIndShockModelFast.ConsIndShockSolverBasicFast(solution_next, IncShkDstn, LivPrb, DiscFac, CRRA, Rfree, PermGroFac, BoroCnstArt, aXtraGrid, vFuncBool, CubicBool)

Bases: HARK.ConsumptionSaving.ConsIndShockModel.ConsIndShockSolverBasic

This class solves a single period of a standard consumption-saving problem, using linear interpolation and without the ability to calculate the value function. ConsIndShockSolver inherits from this class and adds the ability to perform cubic interpolation and to calculate the value function.

Note that this class does not have its own initializing method. It initial- izes the same problem in the same way as ConsIndShockSetup, from which it inherits.

prepare_to_solve()

Perform preparatory work before calculating the unconstrained consumption function. :param none:

Returns:
Return type:none
solve()

Solves a one period consumption saving problem with risky income. :param None:

Returns:solution – The solution to the one period problem.
Return type:ConsumerSolution
class HARK.ConsumptionSaving.ConsIndShockModelFast.ConsIndShockSolverFast(solution_next, IncShkDstn, LivPrb, DiscFac, CRRA, Rfree, PermGroFac, BoroCnstArt, aXtraGrid, vFuncBool, CubicBool)

Bases: HARK.ConsumptionSaving.ConsIndShockModelFast.ConsIndShockSolverBasicFast

This class solves a single period of a standard consumption-saving problem. It inherits from ConsIndShockSolverBasic, adding the ability to perform cubic interpolation and to calculate the value function.

solve()

Solves a one period consumption saving problem with risky income. :param None:

Returns:solution – The solution to the one period problem.
Return type:ConsumerSolution
class HARK.ConsumptionSaving.ConsIndShockModelFast.PerfForesightConsumerTypeFast(**kwargs)

Bases: HARK.ConsumptionSaving.ConsIndShockModel.PerfForesightConsumerType

A perfect foresight consumer type who has no uncertainty other than mortality. His problem is defined by a coefficient of relative risk aversion, intertemporal discount factor, interest factor, an artificial borrowing constraint (maybe) and time sequences of the permanent income growth rate and survival probability.

post_solve()

A method that is run immediately after the model is solved, to finalize the solution in some way. Does nothing here.

Parameters:none
Returns:
Return type:none
solution_terminal_ = <HARK.ConsumptionSaving.ConsIndShockModelFast.PerfForesightSolution object>
update_solution_terminal()

Update the terminal period solution. This method should be run when a new AgentType is created or when CRRA changes.

class HARK.ConsumptionSaving.ConsIndShockModelFast.IndShockConsumerTypeFast(**kwargs)

Bases: HARK.ConsumptionSaving.ConsIndShockModel.IndShockConsumerType, HARK.ConsumptionSaving.ConsIndShockModelFast.PerfForesightConsumerTypeFast

post_solve()

A method that is run immediately after the model is solved, to finalize the solution in some way. Does nothing here.

Parameters:none
Returns:
Return type:none
solution_terminal_ = <HARK.ConsumptionSaving.ConsIndShockModelFast.IndShockSolution object>
update_solution_terminal()

Update the terminal period solution. This method should be run when a new AgentType is created or when CRRA changes.

Parameters:none
Returns:
Return type:none