Skip to content

Commit

Permalink
update notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlujan91 committed Jan 22, 2024
1 parent fb39dfd commit c8649b6
Show file tree
Hide file tree
Showing 9 changed files with 605 additions and 13 deletions.
6 changes: 2 additions & 4 deletions code/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@


class TempConsumerType(AgentType):
def __init__(self, cycles=1, time_flow=True, **kwds):
def __init__(self, cycles=1, **kwds):
"""
Make a new consumer type.
Expand All @@ -74,7 +74,7 @@ def __init__(self, cycles=1, time_flow=True, **kwds):
None
"""
# Initialize a basic AgentType
super().__init__(cycles=cycles, time_flow=time_flow, **kwds)
super().__init__(cycles=cycles, **kwds)
# This estimation uses age-varying discount factors as
# estimated by Cagetti (2003), so switch from time_inv to time_vary
self.add_to_time_vary("DiscFac")
Expand Down Expand Up @@ -125,8 +125,6 @@ class PortfolioLifeCycleConsumerType(TempConsumerType, PortfolioConsumerType):
def post_solve(self):
for solution in self.solution:
solution.cFunc = solution.cFuncAdj
share = solution.ShareFuncAdj
solution.ShareFuncAdj = lambda m: np.clip(share(m), 0.0, 1.0)


class BequestWarmGlowLifeCycleConsumerType(
Expand Down
14 changes: 7 additions & 7 deletions code/calibration/estimation_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
# - Define all of the model parameters for SolvingMicroDSOPs and ConsumerExamples -
# ---------------------------------------------------------------------------------

exp_nest = 3 # Number of times to "exponentially nest" when constructing a_grid
exp_nest = 1 # Number of times to "exponentially nest" when constructing a_grid
aXtraMin = 0.001 # Minimum end-of-period "assets above minimum" value
aXtraMax = 20 # Maximum end-of-period "assets above minimum" value
aXtraMax = 100 # Maximum end-of-period "assets above minimum" value
aXtraHuge = None # A very large value of assets to add to the grid, not used
aXtraExtra = None # Some other value of assets to add to the grid, not used
aXtraCount = 8 # Number of points in the grid of "assets above minimum"
aXtraCount = 200 # Number of points in the grid of "assets above minimum"

# Artificial borrowing constraint; imposed minimum level of end-of period assets
BoroCnstArt = 0.0
Expand All @@ -44,9 +44,9 @@
PermShkCount = 7
# Number of points in discrete approximation to transitory income shocks
TranShkCount = 7
UnempPrb = 0.005 # Probability of unemployment while working
UnempPrbRet = 0.000 # Probability of "unemployment" while retired
IncUnemp = 0.0 # Unemployment benefits replacement rate
UnempPrb = 0.05 # Probability of unemployment while working
UnempPrbRet = 0.005 # Probability of "unemployment" while retired
IncUnemp = 0.3 # Unemployment benefits replacement rate
IncUnempRet = 0.0 # "Unemployment" benefits when retired

final_age = 90 # Age at which the problem ends (die with certainty)
Expand Down Expand Up @@ -74,7 +74,7 @@
)

# Age-varying discount factors over the lifecycle, lifted from Cagetti (2003)
DiscFac_timevary = np.genfromtxt("code/data/Cagetti2003.csv")
DiscFac_timevary = np.genfromtxt("../data/Cagetti2003.csv")

# Survival probabilities over the lifecycle
liv_prb = parse_ssa_life_table(
Expand Down
108 changes: 108 additions & 0 deletions code/notebooks/IndShock.ipynb

Large diffs are not rendered by default.

125 changes: 125 additions & 0 deletions code/notebooks/Portfolio.ipynb

Large diffs are not rendered by default.

107 changes: 107 additions & 0 deletions code/notebooks/WarmGlow.ipynb

Large diffs are not rendered by default.

127 changes: 127 additions & 0 deletions code/notebooks/WarmGlowPortfolio.ipynb

Large diffs are not rendered by default.

127 changes: 127 additions & 0 deletions code/notebooks/WealthPortfolio.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions code/tables/IndShock_estimate_results.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DiscFacAdj,CRRA
0.8783572029816282,3.5160942263466355
DiscFacAdj,CRRA
0.8783572029816282,3.5160942263466355
Expand Down
Empty file removed code/tables/__init__.py
Empty file.

0 comments on commit c8649b6

Please sign in to comment.