ConsGenIncProcessModel#
Classes to solve consumption-saving models with idiosyncratic shocks to income in which shocks are not necessarily fully transitory or fully permanent. Extends ConsIndShockModel by explicitly tracking persistent income as a state variable, and allows (log) persistent income to follow an AR1 process rather than random walk.
- class HARK.ConsumptionSaving.ConsGenIncProcessModel.GenIncProcessConsumerType(**kwds)#
Bases:
IndShockConsumerType
A consumer type with idiosyncratic shocks to persistent and transitory income. His problem is defined by a sequence of income distributions, survival prob- abilities, and persistent income growth functions, as well as time invariant values for risk aversion, discount factor, the interest rate, the grid of end-of-period assets, and an artificial borrowing constraint.
See init_explicit_perm_inc for a dictionary of the keywords that should be passed to the constructor.
- Parameters:
cycles (int) – Number of times the sequence of periods should be solved.
- cFunc_terminal_ = <HARK.interpolation.BilinearInterp object>#
- get_controls()#
Calculates consumption for each consumer of this type using the consumption functions.
- Parameters:
None
- Return type:
None
- get_poststates()#
Calculates end-of-period assets for each consumer of this type. Identical to version in IndShockConsumerType but uses Lvl rather than Nrm variables.
- Parameters:
None
- Return type:
None
- install_retirement_func()#
Installs a special pLvlNextFunc representing retirement in the correct element of self.pLvlNextFunc. Draws on the attributes T_retire and pLvlNextFuncRet. If T_retire is zero or pLvlNextFuncRet does not exist, this method does nothing. Should only be called from within the method update_pLvlNextFunc, which ensures that time is flowing forward.
- Parameters:
None
- Return type:
None
- 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).
- sim_birth(which_agents)#
Makes new consumers for the given indices. Initialized variables include aNrm and pLvl, as well as time variables t_age and t_cycle. Normalized assets and persistent income levels are drawn from lognormal distributions given by aNrmInitMean and aNrmInitStd (etc).
- Parameters:
which_agents (np.array(Bool)) – Boolean array of size self.AgentCount indicating which agents should be “born”.
- Return type:
None
- solution_terminal_ = <HARK.ConsumptionSaving.ConsIndShockModel.ConsumerSolution object>#
- state_vars = ['pLvl', 'mLvl', 'aLvl']#
- transition()#
Calculates updated values of normalized market resources and persistent income level for each agent. Uses pLvlNow, aLvlNow, PermShkNow, TranShkNow.
- Parameters:
None
- Returns:
pLvlNow
mLvlNow
- update()#
Update the income process, the assets grid, the persistent income grid, and the terminal solution.
- Parameters:
None
- Return type:
None
- update_pLvlGrid()#
Update the grid of persistent income levels. Currently only works for infinite horizon models (cycles=0) and lifecycle models (cycles=1). Not clear what to do about cycles>1 because the distribution of persistent income will be different within a period depending on how many cycles have elapsed. This method uses a simulation approach to generate the pLvlGrid at each period of the cycle, drawing on the initial distribution of persistent income, the pLvlNextFuncs, and the attribute pLvlPctiles.
- Parameters:
None
- Return type:
None
- update_pLvlNextFunc()#
A dummy method that creates a trivial pLvlNextFunc attribute that has no persistent income dynamics. This method should be overwritten by subclasses in order to make (e.g.) an AR1 income process.
- Parameters:
None
- Return type:
None
- 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
- Return type:
None
- class HARK.ConsumptionSaving.ConsGenIncProcessModel.IndShockExplicitPermIncConsumerType(**kwds)#
Bases:
GenIncProcessConsumerType
A consumer type with idiosyncratic shocks to permanent and transitory income. The problem is defined by a sequence of income distributions, survival prob- abilities, and permanent income growth rates, as well as time invariant values for risk aversion, discount factor, the interest rate, the grid of end-of- period assets, and an artificial borrowing constraint. This agent type is identical to an IndShockConsumerType but for explicitly tracking pLvl as a state variable during solution. There is no real economic use for it.
- update_pLvlNextFunc()#
A method that creates the pLvlNextFunc attribute as a sequence of linear functions, indicating constant expected permanent income growth across permanent income levels. Draws on the attribute PermGroFac, and installs a special retirement function when it exists.
- Parameters:
None
- Return type:
None
- class HARK.ConsumptionSaving.ConsGenIncProcessModel.PersistentShockConsumerType(**kwds)#
Bases:
GenIncProcessConsumerType
Type with idiosyncratic shocks to persistent (‘Prst’) and transitory income. The problem is defined by a sequence of income distributions, survival prob- abilities, and persistent income growth rates, as well as time invariant values for risk aversion, discount factor, the interest rate, the grid of end-of- period assets, an artificial borrowing constraint, and the AR1 correlation coefficient for (log) persistent income.
- update_pLvlNextFunc()#
A method that creates the pLvlNextFunc attribute as a sequence of AR1-style functions. Draws on the attributes PermGroFac and PrstIncCorr. If cycles=0, the product of PermGroFac across all periods must be 1.0, otherwise this method is invalid.
- Parameters:
None
- Return type:
None
- class HARK.ConsumptionSaving.ConsGenIncProcessModel.pLvlFuncAR1(pLogMean, PermGroFac, Corr)#
Bases:
MetricObject
A class for representing AR1-style persistent income growth functions.