Skip to content

Commit

Permalink
update results by starting from previous results
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlujan91 committed Feb 1, 2024
1 parent d8ae5ef commit f544d42
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 10 deletions.
15 changes: 14 additions & 1 deletion code/estimark/estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
)
from time import time # Timing utility

from pathlib import Path

import matplotlib.pyplot as plt
import numpy as np # Numeric Python

Expand Down Expand Up @@ -562,7 +564,18 @@ def estimate(

targeted_moments = get_targeted_moments()

initial_guess = [parameters.DiscFacAdj_start, parameters.CRRA_start]
# start from previous estimation results if available
try:
csv_file_path = (
Path(__file__).resolve().parent
/ ".."
/ "tables"
/ (estimation_agent + "_estimate_results.csv")
)

initial_guess = np.genfromtxt(csv_file_path, skip_header=1, delimiter=",")
except:
initial_guess = [parameters.DiscFacAdj_start, parameters.CRRA_start]

# Estimate the model using Nelder-Mead
if estimate_model:
Expand Down
2 changes: 1 addition & 1 deletion 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
0.8689011612165243,3.796066262763537
Expand Down
4 changes: 2 additions & 2 deletions code/tables/Portfolio_estimate_results.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DiscFacAdj,CRRA
0.866131986228827,3.7557510682554494
DiscFacAdj,CRRA
0.8193095309029956,4.5574205165556725
Expand Down
4 changes: 2 additions & 2 deletions code/tables/WarmGlowPortfolio_estimate_results.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DiscFacAdj,CRRA
0.8642073648151234,3.8055353724199676
DiscFacAdj,CRRA
0.8246562094500894,4.4642643726332185
Expand Down
4 changes: 2 additions & 2 deletions code/tables/WarmGlow_estimate_results.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DiscFacAdj,CRRA
0.8764224065671837,3.505877643073127
DiscFacAdj,CRRA
0.8755702129442734,3.6158511660969577
Expand Down
4 changes: 2 additions & 2 deletions code/tables/WealthPortfolio_estimate_results.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DiscFacAdj,CRRA
0.6013593197374101,5.031896157976007
DiscFacAdj,CRRA
0.6326006490726698,5.943630057453893
Expand Down

0 comments on commit f544d42

Please sign in to comment.