Skip to content

Commit

Permalink
re-run
Browse files Browse the repository at this point in the history
  • Loading branch information
alanlujan91 committed Feb 20, 2024
1 parent 4c048f4 commit 7eb8e46
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
21 changes: 16 additions & 5 deletions code/estimark/estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def make_estimation_agent(
subjective_stock_market=local_subjective_stock_market,
subjective_labor_market=local_subjective_labor_market,
):

if agent_name == "IndShock":
agent_type = IndShkLifeCycleConsumerType
elif agent_name == "Portfolio":
Expand Down Expand Up @@ -214,7 +213,13 @@ def simulate_moments(
# The simulated time indices corresponding to this age group
cohort_indices = map_simulated_to_empirical_cohorts[g]
# The median of simulated wealth-to-income for this age group
sim_moments += [np.median(sim_w_history[cohort_indices,])]
sim_moments += [
np.median(
sim_w_history[
cohort_indices,
]
)
]

sim_moments = np.array(sim_moments)

Expand Down Expand Up @@ -329,9 +334,15 @@ def calculate_std_err_bootstrap(initial_estimate, N, agent, seed=0, verbose=Fals
bootstrap_data = (
bootstrap_sample_from_data(scf_data.scf_data_array, seed=seed_list[n])
).T
w_to_y_data_bootstrap = bootstrap_data[0,]
empirical_groups_bootstrap = bootstrap_data[1,]
empirical_weights_bootstrap = bootstrap_data[2,]
w_to_y_data_bootstrap = bootstrap_data[
0,
]
empirical_groups_bootstrap = bootstrap_data[
1,
]
empirical_weights_bootstrap = bootstrap_data[
2,
]

# Find moments with bootstrapped sample
bstrap_tgt_moments = get_targeted_moments(
Expand Down
3 changes: 1 addition & 2 deletions code/run_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
)
from estimark.estimation import estimate
import dask
from dask.distributed import Client, progress
from dask.distributed import Client


# Ask the user which replication to run, and run it:
def run_replication():

client = Client(threads_per_worker=10, n_workers=20)

lazy_results = []
Expand Down
2 changes: 1 addition & 1 deletion code/tables/IndShockSub(Labor)Market_estimate_results.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DiscFacAdj,CRRA
0.9826952870424113,3.7682894584977236
0.9826952831981901,3.768367697583021
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DiscFacAdj,CRRA
0.9911787852759087,6.03407974974687
0.9911792106436964,6.034080037474213
Expand Down

0 comments on commit 7eb8e46

Please sign in to comment.