Skip to content

Instantly share code, notes, and snippets.

@larsvilhuber
Last active June 7, 2023 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larsvilhuber/2a1e467aed5c0d0158058161133ce3a8 to your computer and use it in GitHub Desktop.
Save larsvilhuber/2a1e467aed5c0d0158058161133ce3a8 to your computer and use it in GitHub Desktop.
Sample main.m file for repeated strategies
# Instructions to author:
# - Remove ALL paths in each of the files called. They are not needed.
# - Change all lines related to the bootstrap to read:
# [x_M, vc_bs] = bs_abf(match, id_all, strg, K, start_bs, session, bootstrapsize);
#
# This replaces the entire section from the old README:
# Once the MATLAB data is generated, then need to run the MATLAB script est_abf_**.m (depending on whether interested in PD, BoSLI, BOSHI and on the shorter or expanded versions) and to get the results after this script is finished run the corresponding est_test_***.m script. In all these scripts the appropriate path needs to be updated as indicated. Additionally, in all est_abf_**.m scripts the desired bootstrapping needs to be adjusted for each separate estimation at the parts of code starting with [x_M, vc_bs] (for example at line 87 of est_abf_PD_twohalves.m). The MATLAB scripts call on functions bs_abf.m, chis_prb_gf.m, lik_i_abf.m, ll_abf.m, opt_abf.m, and waldtest_gf.m which are all included in the strategies folder.
# ensure all the other functions are found
addpath(genpath('.'));
# Set the size of the bootstrap
bootstrapsize = 1000;
# Example (inferred from imprecise instructions - not sure if this is the right order)
# For BOSHI
est_abf_BOSHI_twohalves_expanded
# NOTE the following only appear to format tables
# It should thus be straightforward to replace with proper code to generate an Excel or LaTeX table
est_tests_BOSHI_fhalf
est_tests_BOSHI_fhalf_expanded
est_tests_BOSHI_shalf_expanded
est_tests_BOSHI_shalf
# Repeat for all the other "strategies"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment