Skip to content

Commit

Permalink
update from Matt's changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlujan91 committed Nov 27, 2024
1 parent 3ce067f commit 0e51243
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
4 changes: 3 additions & 1 deletion src/do_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ def run_replication():
else:
print("Invalid replication choice.")
return


if subjective_markets == "":
subjective_markets = "1"
if int(subjective_markets) > 1:
agent_name += "Sub"

Expand Down
15 changes: 11 additions & 4 deletions src/estimark/estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ def make_agent(agent_name):
if "Portfolio" in agent_name:
track_vars += ["Share"]
agent.track_vars = track_vars
if "WarmGlow" in agent_name:
agent.BeqMPC = 1.0 # dummy value
agent.BeqInt = 1.0

agent.name = agent_name

Expand Down Expand Up @@ -248,9 +251,13 @@ def simulate_moments(params, agent=None, emp_moments=None):
agent.TranShkStd = init_subjective_labor["TranShkStd"]
agent.PermShkStd = init_subjective_labor["PermShkStd"]
agent.update_income_process()


# Update parameters on the agent / construct them
agent.update()

if "WarmGlow" in agent.name:
agent.BeqFac = agent.BeqMPC**(-agent.CRRA)
agent.BeqShift = agent.BeqInt / agent.BeqMPC

# Solve the model for these parameters, then simulate wealth data
agent.solve() # Solve the microeconomic model

Expand Down Expand Up @@ -881,8 +888,8 @@ def estimate(
if __name__ == "__main__":
# Set booleans to determine which tasks should be done
# Which agent type to estimate ("IndShock" or "Portfolio")
local_agent_name = "WealthPortfolio"
local_params_to_estimate = ["CRRA", "WealthShare", "WealthShift"]
local_agent_name = "WarmGlowPortfolio"
local_params_to_estimate = ["CRRA", "BeqMPC", "BeqInt"]
local_estimate_model = True # Whether to estimate the model
# Whether to get standard errors via bootstrap
local_compute_se_bootstrap = False
Expand Down
2 changes: 1 addition & 1 deletion src/estimark/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# resource requirements:
from __future__ import annotations

params_to_estimate = ["CRRA", "BeqShift", "BeqFac", "WealthShare"]
params_to_estimate = ["CRRA", "BeqMPC", "BeqInt", "WealthShare"]

low_resource = {
"estimate_model": True,
Expand Down
20 changes: 10 additions & 10 deletions src/estimark/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@
init_WealthShift = 0.0 # Initial guess of the wealth shift parameter
bounds_WealthShift = [0.0, 100.0] # Bounds for the wealth shift parameter

init_BeqFac = 1.0 # Initial guess of the bequest factor
bounds_BeqFac = [0.0, 100.0] # Bounds for the bequest factor
init_BeqMPC = 0.1 # Initial guess of the pseudo MPC of the bequest motive
bounds_BeqMPC = [0.0, 1.0] # Bounds for the pseudo-MPC of the bequest motive

init_BeqShift = 0.0 # Initial guess of the bequest shift parameter
bounds_BeqShift = [0.0, 70.0] # Bounds for the bequest shift parameter
init_BeqInt = 1.0 # Initial guess of the pseudo intercept of the bequest motive
bounds_BeqInt = [0.0, 10.0] # Bounds for the pseudo intercept of the bequest motive

######################################################################
# Constructed parameters
Expand Down Expand Up @@ -141,24 +141,24 @@
"DiscFac": init_DiscFac,
"WealthShare": init_WealthShare,
"WealthShift": init_WealthShift,
"BeqFac": init_BeqFac,
"BeqShift": init_BeqShift,
"BeqMPC": init_BeqMPC,
"BeqInt": init_BeqInt,
},
"upper_bounds": {
"CRRA": bounds_CRRA[1],
"DiscFac": bounds_DiscFac[1],
"WealthShare": bounds_WealthShare[1],
"WealthShift": bounds_WealthShift[1],
"BeqFac": bounds_BeqFac[1],
"BeqShift": bounds_BeqShift[1],
"BeqMPC": bounds_BeqMPC[1],
"BeqInt": bounds_BeqInt[1],
},
"lower_bounds": {
"CRRA": bounds_CRRA[0],
"DiscFac": bounds_DiscFac[0],
"WealthShare": bounds_WealthShare[0],
"WealthShift": bounds_WealthShift[0],
"BeqFac": bounds_BeqFac[0],
"BeqShift": bounds_BeqShift[0],
"BeqMPC": bounds_BeqMPC[0],
"BeqInt": bounds_BeqInt[0],
},
}

Expand Down

0 comments on commit 0e51243

Please sign in to comment.