Code and raw data for:
Yul HR Kang, Anne Löffler, Danique Jeurissen, Ariel Zylberberg, Daniel M Wolpert, Michael N Shadlen, "Multiple decisions about one object involve parallel sensory acquisition but time-multiplexed evidence incorporation". Biorxiv 2020.10.15.341008 (2020) doi:10.1101/2020.10.15.341008.
Please cite the paper if you use the code and/or the data.
To use pre-computed model outputs, download files from figshare and extract each .zip file under the data
folder (e.g., put the contents of orig.zip
under data/orig/
).
- All MATLAB scripts are in folder
model_fit_RT_models
:run_all_analysis.m
will execute all code that is required to plot the serial and parallel choice-RT fits- Note: By default, the
run_fit_2D()
function will not be called since fitting takes several days to complete. To re-fit the data, runrun_fit_2D.m
on a cluster (see runcode.sh), then manually move files with new fits tofrom_fits
folder and then execute all other functions inrun_all_analysis.m
to create model predictions based on fit parameters
- Note: By default, the
(AZ wrote this part of the code)
- For Fig 2 Suppl 3: To get the BF values for the binary-choice task (pink bars), go to
analysis_binChoice_exp
folder and runrun_sim_binChoice_Fig2_Suppl3.m
(AL wrote this part of the code)
- In Python, set
Decision2D/Decision2DPy
as the working folder, and rundtb.RT.plot_model_comp_dtb_simple.py
to plot supplement 1dtb.RT.plot_nonparam_RT_recovery_MATLAB.py
to plot supplements 2-5
- To fit models anew, move parameter files in
data/Fit.D2.RT.Td2Tnd.Main
elsewhere and runmain_fig2supp2_5.m
. (This may take several days.) - To fit with only a few iterations to see how the code runs, find
'max_iter'
inmain_fig2supp2_5.m
and change it to a small number (e.g., 1). - Then in folder
Decision2D/Decision2DMatlab
, runmain_fig2supp2_5.m
to load and use fitted parameters to export predictions that will be used for plotting.
(YK wrote this part of the code.)
- In MATLAB, go to
analysis_short_Dur_exp
folder and runrun_analysis_short_dur_data.m
(AZ wrote this part of the code.)
- In Python, set
Decision2D/Decision2DPy
as the working folder, and rundtb.VD.dtb_2D_fit_VD.py
to load and use fitted parameters to reproduce the figure. - To fit models anew, move parameter files in
data/Data_2D_Py/dtb/VD/
elsewhere and rundtb_2D_fit_VD.py
. (This may take several days.) - To fit with only a few iterations to see how the code runs, find
'max_epoch0'
indtb_2D_fit_VD.py
and change it to a small number (e.g., 1).
(YK wrote this part of the code.)
- Run
Decision2D/Decision2DPy/dtb/VD/dtb_2D_recover_VD.py
to load and use fitted parameters to reproduce the figure. Note that you need files indata/Data_2D_Py/dtb/VD/
to start this part of the analysis; otherwise the above fits will be run anew. - To fit models anew, move parameter files in
data/Data_2D_Py/dtb/VD_model_recovery/
elsewhere and rundtb_2D_recover_VD.py
. (This may take several days.) - To fit with only a few iterations to see how the code runs, find
'max_epoch0'
indtb_2D_fit_VD.py
and change it to a small number (e.g., 1). Note that this is done the same way as for Figure 4, since both analyses use the same code for fitting.
(YK wrote this part of the code.)
- In MATLAB, go to folder
model_fit_RT_models
and runrun_fig2(2,1,0)
from command window (for re-fitting of model, see instructions above for main Fig 2)
(AZ wrote this part of the code.)
- In MATLAB, go to
model_fit_RT_models
folder and runrun_modelfree_comp_Fig5_Suppl2.m
(AL wrote this part of the code)
- In MATLAB, go to
model_switching_Bimanual
folder and runrun_all_analysis.m
(AZ wrote this part of the code.)
- In MATLAB, go to
analysis_binChoice_exp
folder and runrun_DDM_Fig7.m
to reproduce Fig 7, andrun_gammaRT_Fig7_Suppl1_A.m
andrun_plotModels_Fig7_Suppl1_B.m
for Fig 7 supplement 1.- Note: To re-fit the gamma RT model, simply run
run_gammaRT_Fig7_Suppl1_A.m
, which saves model fits inresults_RTmodel.mat
. This takes a few minutes to run, so for Fig 7 supplement 1B,run_plotModels_Fig7_Suppl1_B.m
does NOT re-fit the model, but simply reads saved results from theresults_RTmodel.mat
file.
- Note: To re-fit the gamma RT model, simply run
(AL and DW wrote this part of the code)