ConsBequestModel#

Classes to solve consumption-saving models with a bequest motive and idiosyncratic shocks to income and wealth. All models here assume separable CRRA utility of consumption and Stone-Geary utility of savings with geometric discounting of the continuation value and shocks to income that have transitory and/or permanent components.

It currently solves two types of models:
  1. A standard lifecycle model with a terminal and/or accidental bequest motive.

  2. A portfolio choice model with a terminal and/or accidental bequest motive.

HARK.ConsumptionSaving.ConsBequestModel.make_bequest_solution_terminal(CRRA, BeqCRRATerm, BeqFacTerm, BeqShiftTerm, aXtraGrid)#

Make the terminal period solution when there is a warm glow bequest motive with Stone-Geary form utility. If there is no warm glow bequest motive (BeqFacTerm = 0), then the terminal period solution is identical to ConsIndShock.

Parameters:
  • CRRA (float) – Coefficient on relative risk aversion over consumption.

  • BeqCRRATerm (float) – Coefficient on relative risk aversion in the terminal warm glow bequest motive.

  • BeqFacTerm (float) – Scaling factor for the terminal warm glow bequest motive.

  • BeqShiftTerm (float) – Stone-Geary shifter term for the terminal warm glow bequest motive.

  • aXtraGrid (np.array) – Set of assets-above-minimum to be used in the solution.

Returns:

solution_terminal – Terminal period solution when there is a warm glow bequest.

Return type:

ConsumerSolution

HARK.ConsumptionSaving.ConsBequestModel.make_warmglow_portfolio_solution_terminal(CRRA, BeqCRRATerm, BeqFacTerm, BeqShiftTerm, aXtraGrid)#

Make the terminal period solution when there is a warm glow bequest motive with Stone-Geary form utility and portfolio choice. If there is no warm glow bequest motive (BeqFacTerm = 0), then the terminal period solution is identical to ConsPortfolio.

Parameters:
  • CRRA (float) – Coefficient on relative risk aversion over consumption.

  • BeqCRRATerm (float) – Coefficient on relative risk aversion in the terminal warm glow bequest motive.

  • BeqFacTerm (float) – Scaling factor for the terminal warm glow bequest motive.

  • BeqShiftTerm (float) – Stone-Geary shifter term for the terminal warm glow bequest motive.

  • aXtraGrid (np.array) – Set of assets-above-minimum to be used in the solution.

Returns:

solution_terminal – Terminal period solution when there is a warm glow bequest and portfolio choice.

Return type:

ConsumerSolution

class HARK.ConsumptionSaving.ConsBequestModel.BequestWarmGlowConsumerType(**kwds)#

Bases: IndShockConsumerType

A consumer type with based on IndShockConsumerType, with an additional bequest motive. They gain utility for any wealth they leave when they die, according to a Stone-Geary utility.

\[\begin{split}\newcommand{\CRRA}{\rho} \newcommand{\DiePrb}{\mathsf{D}} \newcommand{\PermGroFac}{\Gamma} \newcommand{\Rfree}{\mathsf{R}} \newcommand{\DiscFac}{\beta} \begin{align*} v_t(m_t) &= \max_{c_t}u(c_t) + \DiePrb_{t+1} u_{Beq}(a_t)+\DiscFac (1 - \DiePrb_{t+1}) \mathbb{E}_{t} \left[ (\PermGroFac_{t+1} \psi_{t+1})^{1-\CRRA} v_{t+1}(m_{t+1}) \right], \\ & \text{s.t.} \\ a_t &= m_t - c_t, \\ a_t &\geq \underline{a}, \\ m_{t+1} &= a_t \Rfree_{t+1}/(\PermGroFac_{t+1} \psi_{t+1}) + \theta_{t+1}, \\ (\psi_{t+1},\theta_{t+1}) &\sim F_{t+1}, \\ \mathbb{E}[\psi]=\mathbb{E}[\theta] &= 1, \\ u(c) &= \frac{c^{1-\CRRA}}{1-\CRRA} \\ u_{Beq} (a) &= \textbf{BeqFac} \frac{(a+\textbf{BeqShift})^{1-\CRRA_{Beq}}}{1-\CRRA_{Beq}} \\ \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, \(\rho\)) – Coefficient of Relative Risk Aversion.

  • BeqCRRA (float, \(\rho_{Beq}\)) – Coefficient of Relative Risk Aversion for the bequest motive. If this value isn’t the same as CRRA, then the model can only be represented as a Bellman equation. This may cause unintented behavior.

  • BeqCRRATerm (float, \(\rho_{Beq}\)) – The Coefficient of Relative Risk Aversion for the bequest motive, but only in the terminal period. In most cases this should be the same as beqCRRA.

  • BeqShift (float, \(\textbf{BeqShift}\)) – The Shift term from the bequest motive’s utility function. If this value isn’t 0, then the model can only be represented as a Bellman equation. This may cause unintented behavior.

  • BeqShiftTerm (float, \(\textbf{BeqShift}\)) – The shift term from the bequest motive’s utility function, in the terminal period. In most cases this should be the same as beqShift

  • BeqFac (float, \(\textbf{BeqFac}\)) – The weight for the bequest’s utility function.

  • 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.

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

  • BoroCnstArt (float, \(\underline{a}\)) – The minimum Asset/Perminant Income ratio, None to ignore.

  • vFuncBool (bool) – Whether to calculate the value function during solution.

  • CubicBool (bool) – Whether to use cubic spline interpoliation.

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 ‘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

    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.ConsIndShockModel.ConsumerSolution 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.

time_inv_ = ['CRRA', 'DiscFac', 'BoroCnstArt', 'BoroCnstArt', 'vFuncBool', 'CubicBool', 'BeqCRRA', 'BeqShift', 'BeqFac']#
HARK.ConsumptionSaving.ConsBequestModel.solve_one_period_ConsWarmBequest(solution_next, IncShkDstn, LivPrb, DiscFac, CRRA, Rfree, PermGroFac, BoroCnstArt, aXtraGrid, BeqCRRA, BeqFac, BeqShift, CubicBool, vFuncBool)#

Solves one period of a consumption-saving model with idiosyncratic shocks to permanent and transitory income, with one risk free asset and CRRA utility. The consumer also has a “warm glow” bequest motive in which they gain additional utility based on their terminal wealth upon death.

Parameters:
  • solution_next (ConsumerSolution) – The solution to next period’s one period problem.

  • IncShkDstn (distribution.Distribution) – A discrete approximation to the income process between the period being solved and the one immediately following (in solution_next).

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

  • DiscFac (float) – Intertemporal discount factor for future utility.

  • CRRA (float) – Coefficient of relative risk aversion.

  • Rfree (float) – Risk free interest factor on end-of-period assets.

  • PermGroFac (float) – Expected permanent income growth factor at the end of this period.

  • BoroCnstArt (float or None) – Borrowing constraint for the minimum allowable assets to end the period with. If it is less than the natural borrowing constraint, then it is irrelevant; BoroCnstArt=None indicates no artificial bor- rowing constraint.

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

  • BeqCRRA (float) – Coefficient of relative risk aversion for warm glow bequest motive.

  • BeqFac (float) – Multiplicative intensity factor for the warm glow bequest motive.

  • BeqShift (float) – Stone-Geary shifter in the warm glow bequest motive.

  • CubicBool (bool) – An indicator for whether the solver should use cubic or linear interpolation.

  • vFuncBool (boolean) – An indicator for whether the value function should be computed and included in the reported solution.

Returns:

solution_now – Solution to this period’s consumption-saving problem with income risk.

Return type:

ConsumerSolution

HARK.ConsumptionSaving.ConsBequestModel.solve_one_period_ConsPortfolioWarmGlow(solution_next, IncShkDstn, RiskyDstn, LivPrb, DiscFac, CRRA, Rfree, PermGroFac, BoroCnstArt, aXtraGrid, ShareGrid, AdjustPrb, ShareLimit, vFuncBool, DiscreteShareBool, BeqCRRA, BeqFac, BeqShift)#

Solve one period of a consumption-saving problem with portfolio allocation between a riskless and risky asset. This function handles various sub-cases or variations on the problem, including the possibility that the agent does not necessarily get to update their portfolio share in every period, or that they must choose a discrete rather than continuous risky share.

Parameters:
  • solution_next (PortfolioSolution) – Solution to next period’s problem.

  • ShockDstn (Distribution) – Joint distribution of permanent income shocks, transitory income shocks, and risky returns. This is only used if the input IndepDstnBool is False, indicating that income and return distributions can’t be assumed to be independent.

  • IncShkDstn (Distribution) – Discrete distribution of permanent income shocks and transitory income shocks. This is only used if the input IndepDstnBool is True, indicating that income and return distributions are independent.

  • RiskyDstn (Distribution) – Distribution of risky asset returns. This is only used if the input IndepDstnBool is True, indicating that income and return distributions are independent.

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

  • DiscFac (float) – Intertemporal discount factor for future utility.

  • CRRA (float) – Coefficient of relative risk aversion.

  • Rfree (float) – Risk free interest factor on end-of-period assets.

  • PermGroFac (float) – Expected permanent income growth factor at the end of this period.

  • BoroCnstArt (float or None) – Borrowing constraint for the minimum allowable assets to end the period with. In this model, it is required to be zero.

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

  • ShareGrid (np.array) – Array of risky portfolio shares on which to define the interpolation of the consumption function when Share is fixed. Also used when the risky share choice is specified as discrete rather than continuous.

  • AdjustPrb (float) – Probability that the agent will be able to update his portfolio share.

  • ShareLimit (float) – Limiting lower bound of risky portfolio share as mNrm approaches infinity.

  • vFuncBool (boolean) – An indicator for whether the value function should be computed and included in the reported solution.

  • DiscreteShareBool (bool) – Indicator for whether risky portfolio share should be optimized on the continuous [0,1] interval using the FOC (False), or instead only selected from the discrete set of values in ShareGrid (True). If True, then vFuncBool must also be True.

  • IndepDstnBool (bool) – Indicator for whether the income and risky return distributions are in- dependent of each other, which can speed up the expectations step.

  • BeqCRRA (float) – Coefficient of relative risk aversion for warm glow bequest motive.

  • BeqFac (float) – Multiplicative intensity factor for the warm glow bequest motive.

  • BeqShift (float) – Stone-Geary shifter in the warm glow bequest motive.

Returns:

solution_now – Solution to this period’s problem.

Return type:

PortfolioSolution

class HARK.ConsumptionSaving.ConsBequestModel.BequestWarmGlowPortfolioType(**kwds)#

Bases: PortfolioConsumerType

A consumer type with based on PortfolioConsumerType, with an additional bequest motive. They gain utility for any wealth they leave when they die, according to a Stone-Geary utility.

\[\begin{split}\newcommand{\CRRA}{\rho} \newcommand{\DiePrb}{\mathsf{D}} \newcommand{\PermGroFac}{\Gamma} \newcommand{\Rfree}{\mathsf{R}} \newcommand{\DiscFac}{\beta} \begin{align*} v_t(m_t,S_t) &= \max_{c_t,S^{*}_t} u(c_t) + \DiePrb_{t+1} u_{Beq}(a_t)+ \DiscFac (1-\DiePrb_{t+1}) \mathbb{E}_{t} \left[(\PermGroFac_{t+1}\psi_{t+1})^{1-\CRRA} v_{t+1}(m_{t+1},S_{t+1}) \right], \\ & \text{s.t.} \\ a_t &= m_t - c_t, \\ a_t &\geq \underline{a}, \\ m_{t+1} &= \mathsf{R}_{t+1}/(\PermGroFac_{t+1} \psi_{t+1}) a_t + \theta_{t+1}, \\ \mathsf{R}_{t+1} &=S_t\phi_{t+1}\mathbf{R}_{t+1}+ (1-S_t)\mathsf{R}_{t+1}, \\ S_{t+1} &= \begin{cases} S^{*}_t & \text{if } p_t < \wp\\ S_t & \text{if } p_t \geq \wp, \end{cases}\\ (\psi_{t+1},\theta_{t+1},\phi_{t+1},p_t) &\sim F_{t+1}, \\ \mathbb{E}[\psi]=\mathbb{E}[\theta] &= 1. \\ u(c) &= \frac{c^{1-\CRRA}}{1-\CRRA} \\ u_{Beq} (a) &= \textbf{BeqFac} \frac{(a+\textbf{BeqShift})^{1-\CRRA_{Beq}}}{1-\CRRA_{Beq}} \\ \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, \(\rho\)) – Coefficient of Relative Risk Aversion.

  • BeqCRRA (float, \(\rho_{Beq}\)) – Coefficient of Relative Risk Aversion for the bequest motive. If this value isn’t the same as CRRA, then the model can only be represented as a Bellman equation. This may cause unintented behavior.

  • BeqCRRATerm (float, \(\rho_{Beq}\)) – The Coefficient of Relative Risk Aversion for the bequest motive, but only in the terminal period. In most cases this should be the same as beqCRRA.

  • BeqShift (float, \(\textbf{BeqShift}\)) – The Shift term from the bequest motive’s utility function. If this value isn’t 0, then the model can only be represented as a Bellman equation. This may cause unintented behavior.

  • BeqShiftTerm (float, \(\textbf{BeqShift}\)) – The shift term from the bequest motive’s utility function, in the terminal period. In most cases this should be the same as beqShift

  • BeqFac (float, \(\textbf{BeqFac}\)) – The weight for the bequest’s utility function.

  • 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.

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

  • BoroCnstArt (float, default=0.0, \(\underline{a}\)) – The minimum Asset/Perminant Income ratio. for this agent, BoroCnstArt must be 0.

  • vFuncBool (bool) – Whether to calculate the value function during solution.

  • CubicBool (bool) – Whether to use cubic spline interpoliation.

  • AdjustPrb (float or list[float], time varying) – Must be between 0 and 1. Probability that the agent can update their risky portfolio share each period. Pass a list of floats to make AdjustPrb time varying.

Simulation Parameters:
  • sim_common_Rrisky (Boolean) – Whether risky returns have a shared/common value across agents. If True, Risky return’s can’t be time varying.

  • 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 ‘Adjust’, ‘PermShk’, ‘Risky’, ‘TranShk’, ‘aLvl’, ‘aNrm’, ‘bNrm’, ‘cNrm’, ‘mNrm’, ‘pLvl’, and ‘who_dies’.

    Adjust is the array of which agents can adjust

    PermShk is the agent’s permanent income shock

    Risky is the agent’s risky asset 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

    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.ConsPortfolioModel.PortfolioSolution 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.

time_inv_ = ['CRRA', 'DiscFac', 'BoroCnstArt', 'BoroCnstArt', 'vFuncBool', 'CubicBool', 'PortfolioBisect', 'AdjustPrb', 'DiscreteShareBool', 'BeqCRRA', 'BeqShift', 'BeqFac']#