ConsLaborModel#

Subclasses of AgentType representing consumers who make decisions about how much labor to supply, as well as a consumption-saving decision.

It currently only has one model: labor supply on the intensive margin (unit interval) with CRRA utility from a composite good (of consumption and leisure), with transitory and permanent productivity shocks. Agents choose their quantities of labor and consumption after observing both of these shocks, so the transitory shock is a state variable.

class HARK.ConsumptionSaving.ConsLaborModel.ConsumerLaborSolution(cFunc=None, LbrFunc=None, vFunc=None, vPfunc=None, bNrmMin=None)#

Bases: MetricObject

A class for representing one period of the solution to a Consumer Labor problem.

Parameters:
  • cFunc (function) – The consumption function for this period, defined over normalized bank balances and the transitory productivity shock: cNrm = cFunc(bNrm,TranShk).

  • LbrFunc (function) – The labor supply function for this period, defined over normalized bank balances: Lbr = LbrFunc(bNrm,TranShk).

  • vFunc (function) – The beginning-of-period value function for this period, defined over normalized bank balances: v = vFunc(bNrm,TranShk).

  • vPfunc (function) – The beginning-of-period marginal value (of bank balances) function for this period, defined over normalized bank balances: vP = vPfunc(bNrm,TranShk).

  • bNrmMin (float) – The minimum allowable bank balances for this period, as a function of the transitory shock. cFunc, LbrFunc, etc are undefined for bNrm < bNrmMin(TranShk).

distance_criteria = ['cFunc', 'LbrFunc']#
HARK.ConsumptionSaving.ConsLaborModel.make_log_polynomial_LbrCost(T_cycle, LbrCostCoeffs)#

Construct the age-varying cost of working LbrCost using polynomial coefficients (over t_cycle) for (log) LbrCost.

\[\text{LbrCost}_{t}=\exp(\sum \text{LbrCostCoeffs}_n t^{n})\]
Parameters:
  • T_cycle (int) – Number of non-terminal period’s in the agent’s problem.

  • LbrCostCoeffs ([float]) – List or array of arbitrary length, representing polynomial coefficients of t = 0,…,T_cycle, which determine (log) LbrCost.

Returns:

LbrCost – List of age-dependent labor utility cost parameters.

Return type:

[float]

HARK.ConsumptionSaving.ConsLaborModel.make_labor_intmarg_solution_terminal(CRRA, aXtraGrid, LbrCost, WageRte, TranShkGrid)#

Constructs the terminal period solution and solves for optimal consumption and labor when there is no future.

Parameters:

None

Return type:

None

HARK.ConsumptionSaving.ConsLaborModel.solve_ConsLaborIntMarg(solution_next, PermShkDstn, TranShkDstn, LivPrb, DiscFac, CRRA, Rfree, PermGroFac, BoroCnstArt, aXtraGrid, TranShkGrid, vFuncBool, CubicBool, WageRte, LbrCost)#

Solves one period of the consumption-saving model with endogenous labor supply on the intensive margin by using the endogenous grid method to invert the first order conditions for optimal composite consumption and between consumption and leisure, obviating any search for optimal controls.

Parameters:
  • solution_next (ConsumerLaborSolution) – The solution to the next period’s problem; must have the attributes vPfunc and bNrmMinFunc representing marginal value of bank balances and minimum (normalized) bank balances as a function of the transitory shock.

  • PermShkDstn ([np.array]) – Discrete distribution of permanent productivity shocks.

  • TranShkDstn ([np.array]) – Discrete distribution of transitory productivity shocks.

  • LivPrb (float) – Survival probability; likelihood of being alive at the beginning of the succeeding period.

  • DiscFac (float) – Intertemporal discount factor.

  • CRRA (float) – Coefficient of relative risk aversion over the composite good.

  • Rfree (float) – Risk free interest rate on assets retained at the end of the period.

  • PermGroFac (float) – Expected permanent income growth factor for next period.

  • BoroCnstArt (float or None) – Borrowing constraint for the minimum allowable assets to end the period with. Currently not handled, must be None.

  • aXtraGrid (np.array) – Array of “extra” end-of-period asset values– assets above the absolute minimum acceptable level.

  • TranShkGrid (np.array) – Grid of transitory shock values to use as a state grid for interpolation.

  • vFuncBool (boolean) – An indicator for whether the value function should be computed and included in the reported solution. Not yet handled, must be False.

  • CubicBool (boolean) – An indicator for whether the solver should use cubic or linear interpolation. Cubic interpolation is not yet handled, must be False.

  • WageRte (float) – Wage rate per unit of labor supplied.

  • LbrCost (float) – Cost parameter for supplying labor: \(u_t = U(x_t)\), \(x_t = c_t z_t^{LbrCost}\), where \(z_t\) is leisure \(= 1 - Lbr_t\).

Returns:

solution_now – The solution to this period’s problem, including a consumption function cFunc, a labor supply function LbrFunc, and a marginal value function vPfunc; each are defined over normalized bank balances and transitory prod shock. Also includes bNrmMinNow, the minimum permissible bank balances as a function of the transitory productivity shock.

Return type:

ConsumerLaborSolution

class HARK.ConsumptionSaving.ConsLaborModel.LaborIntMargConsumerType(**kwds)#

Bases: IndShockConsumerType

A class representing agents who make a decision each period about how much to consume vs save and how much labor to supply (as a fraction of their time). They get CRRA utility from a composite good \(x_t = c_t*z_t^alpha\), and discount future utility flows at a constant factor.

\[\begin{split}\newcommand{\CRRA}{\rho} \newcommand{\DiePrb}{\mathsf{D}} \newcommand{\PermGroFac}{\Gamma} \newcommand{\Rfree}{\mathsf{R}} \newcommand{\DiscFac}{\beta} \begin{align*} v_t(b_t,\theta_{t}) &= \max_{c_t,L_{t}}u_{t}(c_t,L_t) + \DiscFac (1 - \DiePrb_{t+1}) \mathbb{E}_{t} \left[ (\PermGroFac_{t+1} \psi_{t+1})^{1-\CRRA} v_{t+1}(b_{t+1},\theta_{t+1}) \right], \\ & \text{s.t.} \\ a_t &= m_t - c_t, \\ m_{t+1} &= b_{t+1} + L_{t}\theta_{t} \text{WageRte}_{t}, \\ b_{t+1} &= a_t \Rfree_{t+1}/(\PermGroFac_{t+1} \psi_{t+1}), \\ (\psi_{t+1},\theta_{t+1}) &\sim F_{t+1}, \\ \mathbb{E}[\psi]=\mathbb{E}[\theta] &= 1, \\ u_{t}(c,L) &= \frac{(c (1-L)^{\alpha_t})^{1-\CRRA}}{1-\CRRA} \\ \end{align*}\end{split}\]
Constructors:
Solving Parameters:
  • cycles (int) – 0 specifies an infinite horizon model, 1 specifies a finite model.

  • T_cycle (int) – Number of periods in the cycle for this agent type.

  • CRRA (float, default=2.0, \(\rho\)) – Coefficient of Relative Risk Aversion. Must be greater than \(\max_{t}({\frac{\alpha_t}{\alpha_t+1}})\)

  • Rfree (float or list[float], time varying, \(\mathsf{R}\)) – Risk Free interest rate. Pass a list of floats to make Rfree time varying.

  • DiscFac (float, \(\beta\)) – Intertemporal discount factor.

  • LivPrb (list[float], time varying, \(1-\mathsf{D}\)) – Survival probability after each period.

  • WageRte (list[float], time varying) – Wage rate paid on labor income.

  • PermGroFac (list[float], time varying, \(\Gamma\)) – Permanent income growth factor.

Simulation Parameters:
  • AgentCount (int) – Number of agents of this kind that are created during simulations.

  • T_age (int) – Age after which to automatically kill agents, None to ignore.

  • T_sim (int, required for simulation) – Number of periods to simulate.

  • track_vars (list[strings]) – List of variables that should be tracked when running the simulation. For this agent, the options are ‘Lbr’, ‘PermShk’, ‘TranShk’, ‘aLvl’, ‘aNrm’, ‘bNrm’, ‘cNrm’, ‘mNrm’, ‘pLvl’, and ‘who_dies’.

    PermShk is the agent’s permanent income shock

    TranShk is the agent’s transitory income shock

    aLvl is the nominal asset level

    aNrm is the normalized assets

    bNrm is the normalized resources without this period’s labor income

    cNrm is the normalized consumption

    mNrm is the normalized market resources

    pLvl is the permanent income level

    Lbr is the share of the agent’s time spent working

    who_dies is the array of which agents died

  • aNrmInitMean (float) – Mean of Log initial Normalized Assets.

  • aNrmInitStd (float) – Std of Log initial Normalized Assets.

  • pLvlInitMean (float) – Mean of Log initial permanent income.

  • pLvlInitStd (float) – Std of Log initial permanent income.

  • PermGroFacAgg (float) – Aggregate permanent income growth factor (The portion of PermGroFac attributable to aggregate productivity growth).

  • PerfMITShk (boolean) – Do Perfect Foresight MIT Shock (Forces Newborns to follow solution path of the agent they replaced if True).

  • NewbornTransShk (boolean) – Whether Newborns have transitory shock.

Attributes:
  • solution (list[Consumer solution object]) – Created by the solve() method. Finite horizon models create a list with T_cycle+1 elements, for each period in the solution. Infinite horizon solutions return a list with T_cycle elements for each period in the cycle.

    Visit HARK.ConsumptionSaving.ConsLaborModel.ConsumerLaborSolution for more information about the solution.

  • history (Dict[Array]) – Created by running the simulate() method. Contains the variables in track_vars. Each item in the dictionary is an array with the shape (T_sim,AgentCount). Visit HARK.core.AgentType.simulate for more information.

IncShkDstn_default = {'IncUnemp': 0.0, 'IncUnempRet': 0.0, 'PermShkCount': 16, 'PermShkStd': [0.1], 'T_retire': 0, 'TranShkCount': 15, 'TranShkStd': [0.1], 'UnempPrb': 0.05, 'UnempPrbRet': 0.005}#
aXtraGrid_default = {'aXtraCount': 200, 'aXtraExtra': None, 'aXtraMax': 80.0, 'aXtraMin': 0.001, 'aXtraNestFac': 3}#
LbrCost_default = {'LbrCostCoeffs': [-1.0]}#
solving_default = {'BoroCnstArt': None, 'CRRA': 2.0, 'CubicBool': False, 'DiscFac': 0.96, 'LivPrb': [0.98], 'PermGroFac': [1.01], 'Rfree': 1.03, 'T_cycle': 1, 'WageRte': [1.0], 'constructors': {'IncShkDstn': <function construct_lognormal_income_process_unemployment>, 'LbrCost': <function make_log_polynomial_LbrCost>, 'PermShkDstn': <function get_PermShkDstn_from_IncShkDstn>, 'TranShkDstn': <function get_TranShkDstn_from_IncShkDstn>, 'TranShkGrid': <function get_TranShkGrid_from_TranShkDstn>, 'aXtraGrid': <function make_assets_grid>, 'solution_terminal': <function make_labor_intmarg_solution_terminal>}, 'cycles': 1, 'vFuncBool': False}#
simulation_default = {'AgentCount': 10000, 'NewbornTransShk': False, 'PerfMITShk': False, 'PermGroFacAgg': 1.0, 'T_age': None, 'aNrmInitMean': 0.0, 'aNrmInitStd': 1.0, 'neutral_measure': False, 'pLvlInitMean': 0.0, 'pLvlInitStd': 0.0}#
time_vary_ = ['LivPrb', 'PermGroFac', 'WageRte']#
time_inv_ = ['CRRA', 'DiscFac', 'BoroCnstArt', 'BoroCnstArt', 'vFuncBool', 'CubicBool']#
update()#

Update the income process, the assets grid, and the terminal solution.

Parameters:

None

Return type:

None

calc_bounding_values()#

NOT YET IMPLEMENTED FOR THIS CLASS

make_euler_error_func(mMax=100, approx_inc_dstn=True)#

NOT YET IMPLEMENTED FOR THIS CLASS

get_states()#

Calculates updated values of normalized bank balances and permanent income level for each agent. Uses pLvlNow, aNrmNow, PermShkNow. Calls the get_states method for the parent class, then erases mNrmNow, which cannot be calculated until after get_controls in this model.

Parameters:

None

Return type:

None

get_controls()#

Calculates consumption and labor supply for each consumer of this type using the consumption and labor functions in each period of the cycle.

Parameters:

None

Return type:

None

get_poststates()#

Calculates end-of-period assets for each consumer of this type.

Parameters:

None

Return type:

None

plot_cFunc(t, bMin=None, bMax=None, ShkSet=None)#

Plot the consumption function by bank balances at a given set of transitory shocks.

Parameters:
  • t (int) – Time index of the solution for which to plot the consumption function.

  • bMin (float or None) – Minimum value of bNrm at which to begin the plot. If None, defaults to the minimum allowable value of bNrm for each transitory shock.

  • bMax (float or None) – Maximum value of bNrm at which to end the plot. If None, defaults to bMin + 20.

  • ShkSet ([float] or None) – Array or list of transitory shocks at which to plot the consumption function. If None, defaults to the TranShkGrid for this time period.

Return type:

None

plot_LbrFunc(t, bMin=None, bMax=None, ShkSet=None)#

Plot the labor supply function by bank balances at a given set of transitory shocks.

Parameters:
  • t (int) – Time index of the solution for which to plot the labor supply function.

  • bMin (float or None) – Minimum value of bNrm at which to begin the plot. If None, defaults to the minimum allowable value of bNrm for each transitory shock.

  • bMax (float or None) – Maximum value of bNrm at which to end the plot. If None, defaults to bMin + 20.

  • ShkSet ([float] or None) – Array or list of transitory shocks at which to plot the labor supply function. If None, defaults to the TranShkGrid for this time period.

Return type:

None