-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
023f868
commit 4c048f4
Showing
20 changed files
with
119 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
from estimark.calibration.options import ( | ||
all_replications, | ||
high_resource, | ||
low_resource, | ||
medium_resource, | ||
) | ||
from estimark.estimation import estimate | ||
import dask | ||
from dask.distributed import Client, progress | ||
|
||
|
||
# Ask the user which replication to run, and run it: | ||
def run_replication(): | ||
|
||
client = Client(threads_per_worker=10, n_workers=20) | ||
|
||
lazy_results = [] | ||
|
||
for i in range(1, 6): | ||
which_model = str(i) | ||
which_replication = "1" | ||
for k in range(1, 5): | ||
subjective_markets = str(k) | ||
|
||
replication_specs = {} | ||
|
||
if which_model == "1" or which_model == "": | ||
replication_specs["agent_name"] = "IndShock" | ||
elif which_model == "2": | ||
replication_specs["agent_name"] = "Portfolio" | ||
elif which_model == "3": | ||
replication_specs["agent_name"] = "WarmGlow" | ||
elif which_model == "4": | ||
replication_specs["agent_name"] = "WarmGlowPortfolio" | ||
elif which_model == "5": | ||
replication_specs["agent_name"] = "WealthPortfolio" | ||
else: | ||
print("Invalid model choice.") | ||
return | ||
|
||
print("Model: ", replication_specs["agent_name"]) | ||
|
||
if which_replication == "q": | ||
return | ||
|
||
elif which_replication == "1" or which_replication == "": | ||
print("Running low-resource replication...") | ||
replication_specs.update(**low_resource) | ||
|
||
elif which_replication == "2": | ||
print("Running medium-resource replication...") | ||
replication_specs.update(**medium_resource) | ||
|
||
elif which_replication == "3": | ||
print("Running high-resource replication...") | ||
replication_specs.update(**high_resource) | ||
|
||
elif which_replication == "4": | ||
print("Running all replications...") | ||
replication_specs.update(**all_replications) | ||
|
||
else: | ||
print("Invalid replication choice.") | ||
return | ||
|
||
if subjective_markets == "2" or subjective_markets == "4": | ||
replication_specs["subjective_stock_market"] = True | ||
print("Adding subjective stock market beliefs...") | ||
|
||
if subjective_markets == "3" or subjective_markets == "4": | ||
replication_specs["subjective_labor_market"] = True | ||
print("Adding subjective labor market beliefs...") | ||
|
||
lazy_result = dask.delayed(estimate)(**replication_specs) | ||
lazy_results.append(lazy_result) | ||
|
||
dask.compute(*lazy_results) | ||
|
||
|
||
if __name__ == "__main__": | ||
run_replication() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DiscFacAdj,CRRA | ||
0.9826952870424113,3.7682894584977236 | ||
|
2 changes: 1 addition & 1 deletion
2
code/tables/IndShockSub(Stock)(Labor)Market_estimate_results.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
DiscFacAdj,CRRA | ||
0.9900216884662436,4.1368574835978205 | ||
0.990059541559503,4.128239153345464 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DiscFacAdj,CRRA | ||
0.9628905096680382,1.442713138370085 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
DiscFacAdj,CRRA | ||
0.9552205116274122,1.3759978446748666 | ||
0.9561845217685123,1.3419829066995432 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DiscFacAdj,CRRA | ||
0.9909618480820204,5.986965941730887 | ||
|
2 changes: 1 addition & 1 deletion
2
code/tables/PortfolioSub(Stock)(Labor)Market_estimate_results.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
DiscFacAdj,CRRA | ||
0.9911742480356607,6.034052128020187 | ||
0.9911787852759087,6.03407974974687 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DiscFacAdj,CRRA | ||
0.9913555579379695,6.010819574001086 | ||
|
2 changes: 2 additions & 0 deletions
2
code/tables/WarmGlowPortfolioSub(Labor)Market_estimate_results.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DiscFacAdj,CRRA | ||
0.9756576356903954,8.845926577241347 | ||
|
2 changes: 1 addition & 1 deletion
2
code/tables/WarmGlowPortfolioSub(Stock)(Labor)Market_estimate_results.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
DiscFacAdj,CRRA | ||
0.9756577076244863,8.846001517130244 | ||
0.9756558075814038,8.846028566854438 | ||
|
2 changes: 2 additions & 0 deletions
2
code/tables/WarmGlowPortfolioSub(Stock)Market_estimate_results.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DiscFacAdj,CRRA | ||
0.9756576356903954,8.845926577241347 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
DiscFacAdj,CRRA | ||
0.9273982467678095,1.4720190125393666 | ||
0.9756570720304689,8.846018147853837 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DiscFacAdj,CRRA | ||
0.9791782282367655,4.231669394199844 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DiscFacAdj,CRRA | ||
0.9861734987743034,4.425678459697778 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
DiscFacAdj,CRRA | ||
0.9530437585281377,1.386246664352366 | ||
0.9861338473449703,4.436057123654957 | ||
|
2 changes: 2 additions & 0 deletions
2
code/tables/WealthPortfolioSub(Labor)Market_estimate_results.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DiscFacAdj,CRRA | ||
0.8407456786079042,7.526834053433991 | ||
|
2 changes: 2 additions & 0 deletions
2
code/tables/WealthPortfolioSub(Stock)Market_estimate_results.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DiscFacAdj,CRRA | ||
0.6902949988467191,5.143158466987802 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
DiscFacAdj,CRRA | ||
0.6772594280853925,5.019468591453271 | ||
0.6741600851429033,5.044372293670781 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters