Data and code provided by the Rangel Neuroeconomics Lab at
the California Institute of Technology, to accompany the
paper "The attentional drift-diffusion mode of simple
perceptual decision-making", by Gabriela Tavares, Pietro
Perona and Antonio Rangel.

Code author: Gabriela Tavares, gtavares@caltech.edu

The main directory contains 2 subdirectories, Experiment1 and
Experiment2, for each of the 2 experiments described in
the paper. Each of these contains directories corresponding
to Python and Matlab code.

The Python code was used to perform model fitting and model
simulations for Experiment 1. The most recent version of this
code can be obtained in the following GitHub repo:
github.com/goptavares/aDDM-Toolbox

The Experiment1/python directory contains the following
modules:
- util.py contains utility functions.
- addm.py contains the aDDM implementation, with functions
to generate model simulations and obtain the likelihood
for a given data trial.
- addm_posteriors.py performs model comparison by obtaining
a posterior distribution over a set of models.
- simulate_addm_true_distributions.py generates aDDM
simulations using empirical data for the fixations.
- make model predictions compares the aDDM with the classical
DDM, estimating RT and choice and comparing the models’
results to the empirical data.

The Matlab code was written for Matlab v2016b. Running it
in other versions may lead to minor incompatibility issues.

All behavioral data collected in each experiment is in a
directory called expdata, while the eyetracking data is
in a directory called eyetracking_data. Data files are
named using a 3 letter subject code and the number of
the experimental session. The behavioral data is stored
in Matlab ".mat" files, while the eyetracking data is
stored in ASCII ".asc" files.

For Experiment1, 6 main scripts are provided (plus several
helper functions):
- CompareDataAndModel.m: generates several plots
comparing the behavioral data with simulations.
- CompareEarlyAndLateMemoryTrials.m: generates several
plots comparing trials occurring immediately after target
display with those occurring 4 trials after target dislpay.
- ExportDataToCsv.m: writes all behavioral and
eyetracking data to .csv files (useful if the data needs
to be read by programs other than Matlab).
- FixationsAnalysis.m: generates plots to show the
statistics of visual fixations in the data.
- GroupStats.m: prints some behavioral statistics.
- QuantileProbabilityFunctions.m: generates quantile
probability function plots for the behavioral data
or simulations from a model.

In the Experiment1 directory, we provide 3 different sets
of model simulations: model1_expdata and model1_fixations
correspond to the fitted aDDM from the paper;
model2_expdata and model2_fixations correspond to the
aDDM fitted with theta=0; and model3_expdata and
model3_fixations correspond to the aDDM fitted with
theta=1 (equivalent to the DDM). Additional simulations
can be generated using the aDDM-Toolbox, available on
GitHub: github.com/goptavares/aDDM-Toolbox

For Experiment2, 1 main script is provided (plus several
helper functions):
- DataAnalysis.m: generates several plots to investigate
the effects of the causal manipulation, as well as
comparisons between the data from experiments 1 and 2.

