Skip to content

Commit

Permalink
example notebooks
Browse files Browse the repository at this point in the history
Notebooks featuring the bequest portfolio consumer type almost complete.

There is a minor issue in the notebooks: for some reason, the accidental and terminal bequest portfolio types are returning the same consumption functions and wealth moments. This obviously should not occur, since the dictionary creates instances with different parameter values.
  • Loading branch information
dedwar65 committed Mar 28, 2024
1 parent 63e8bb1 commit ae0358e
Show file tree
Hide file tree
Showing 5 changed files with 192 additions and 188 deletions.
33 changes: 13 additions & 20 deletions HARK/ConsumptionSaving/ConsBequestModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,18 @@
"""

import numpy as np

from HARK.ConsumptionSaving.ConsIndShockModel import (
ConsIndShockSolver,
IndShockConsumerType,
init_idiosyncratic_shocks,
init_lifecycle,
)
from HARK.ConsumptionSaving.ConsPortfolioModel import (
ConsPortfolioSolver,
PortfolioConsumerType,
PortfolioSolution,
init_portfolio,
)
ConsIndShockSolver, IndShockConsumerType, init_idiosyncratic_shocks,
init_lifecycle)
from HARK.ConsumptionSaving.ConsPortfolioModel import (ConsPortfolioSolver,
PortfolioConsumerType,
PortfolioSolution,
init_portfolio)
from HARK.core import make_one_period_oo_solver
from HARK.interpolation import (
ConstantFunction,
IdentityFunction,
LinearInterp,
MargMargValueFuncCRRA,
MargValueFuncCRRA,
ValueFuncCRRA,
)
from HARK.interpolation import (ConstantFunction, IdentityFunction,
LinearInterp, MargMargValueFuncCRRA,
MargValueFuncCRRA, ValueFuncCRRA)
from HARK.rewards import UtilityFuncCRRA, UtilityFuncStoneGeary


Expand Down Expand Up @@ -352,7 +343,7 @@ def calc_EndOfPrdvP(self):

init_wealth_in_utility = init_idiosyncratic_shocks.copy()
init_wealth_in_utility["BeqCRRA"] = init_idiosyncratic_shocks["CRRA"]
init_wealth_in_utility["BeqFac"] = 1.0
init_wealth_in_utility["BeqFac"] = 0.0
init_wealth_in_utility["BeqShift"] = 0.0
init_wealth_in_utility["TermBeqCRRA"] = init_idiosyncratic_shocks["CRRA"]
init_wealth_in_utility["TermBeqFac"] = 0.0 # ignore bequest motive in terminal period
Expand All @@ -362,6 +353,8 @@ def calc_EndOfPrdvP(self):
init_warm_glow["TermBeqCRRA"] = init_lifecycle["CRRA"]
init_warm_glow["TermBeqFac"] = 1.0
init_warm_glow["TermBeqShift"] = 0.0
init_warm_glow["BeqFac"] = 0.0 # Value of bequest relative to consumption
init_warm_glow["BeqShift"] = 0.0 # Shifts the utility function

init_accidental_bequest = init_warm_glow.copy()
init_accidental_bequest["BeqFac"] = 1.0 # Value of bequest relative to consumption
Expand Down
8 changes: 4 additions & 4 deletions examples/ConsBequestModel/example_AccidentalBequest.ipynb

Large diffs are not rendered by default.

187 changes: 97 additions & 90 deletions examples/ConsBequestModel/example_AccidentalBequestPort.ipynb

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions examples/ConsBequestModel/example_TerminalBequest.ipynb

Large diffs are not rendered by default.

144 changes: 74 additions & 70 deletions examples/ConsBequestModel/example_TerminalBequestPort.ipynb

Large diffs are not rendered by default.

0 comments on commit ae0358e

Please sign in to comment.