From 7eb8e4694ce9181934d488a148583f3450892a97 Mon Sep 17 00:00:00 2001 From: alanlujan91 Date: Tue, 20 Feb 2024 10:27:40 -0500 Subject: [PATCH] re-run --- code/estimark/estimation.py | 21 ++++++++++++++----- code/run_all.py | 3 +-- ...ShockSub(Labor)Market_estimate_results.csv | 2 +- ...b(Stock)(Labor)Market_estimate_results.csv | 2 +- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/code/estimark/estimation.py b/code/estimark/estimation.py index a073805..47696a5 100644 --- a/code/estimark/estimation.py +++ b/code/estimark/estimation.py @@ -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": @@ -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) @@ -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( diff --git a/code/run_all.py b/code/run_all.py index cb0e456..64e531b 100644 --- a/code/run_all.py +++ b/code/run_all.py @@ -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 = [] diff --git a/code/tables/IndShockSub(Labor)Market_estimate_results.csv b/code/tables/IndShockSub(Labor)Market_estimate_results.csv index dc75571..f91c3cd 100644 --- a/code/tables/IndShockSub(Labor)Market_estimate_results.csv +++ b/code/tables/IndShockSub(Labor)Market_estimate_results.csv @@ -1,2 +1,2 @@ DiscFacAdj,CRRA -0.9826952870424113,3.7682894584977236 +0.9826952831981901,3.768367697583021 diff --git a/code/tables/PortfolioSub(Stock)(Labor)Market_estimate_results.csv b/code/tables/PortfolioSub(Stock)(Labor)Market_estimate_results.csv index 4f3d2b6..f1d2ef5 100644 --- a/code/tables/PortfolioSub(Stock)(Labor)Market_estimate_results.csv +++ b/code/tables/PortfolioSub(Stock)(Labor)Market_estimate_results.csv @@ -1,2 +1,2 @@ DiscFacAdj,CRRA -0.9911787852759087,6.03407974974687 +0.9911792106436964,6.034080037474213