DOI: 10.5061/dryad.02v6wwq6b
title: Decision-making in dynamic, continuously evolving environments: Quantifying the flexibility of human choice

description: # Decision-making in dynamic, continuously evolving environments:
 Quantifying the flexibility of human choice
 [https://doi.org/10.5061/dryad.02v6wwq6b](https://doi.org/10.5061/dryad.02v6wwq6b) This repository contains EEG and behavioural data from a study of continuous decision making in a random-dot kinteogram paradigm, in which participants aim to detect consistent periods of motion ('response periods') in background noise. Participants complete 6 blocks, each consisting of 4 conditions (different 'environments'). Each condition lasts 5 minutes. Full details of the paradigm are given in the preprint at [https://www.biorxiv.org/content/10.1101/2022.08.18.504278.abstract](https://www.biorxiv.org/content/10.1101/2022.08.18.504278.abstract). *** ## Description of the data and file structure The location of data files in the repository are highlighted in **bold**, and the relevant MATLAB functions to load/explore the data are given in *italics*. Code to analyse this data is stored at our online code respository, [https://github.com/CCNHuntLab/ruesseler-eeg-analysis](https://github.com/CCNHuntLab/ruesseler-eeg-analysis). ### A. Participant information. **participantInfo.xlsx** is an Excel spreadsheet that gives information about participants IDs and who is pilot, study, control. You will see that the IDs are not consecutive numbers -- this is because we always gave everyone interested in the study (and receiving participant information sheet) a number and put them on a separate excel sheet with contact details etc (this is a separate, locked file which is not included with this dataset). The initial participants were pilot subjects from our lab, several of whom trained themselves on their own computers and for whom we don't have their training data (until subject 7). We also include in this spreadsheet some info on people excluded because they were unable to do the task, and/or several which have a bad EEG channel problem that were also excluded from further analysis. ### B. Behavioural and EEG data. There are 4 folders that contain the data. 1. Preprocessed data: * Behaviour: 1 matlab file for main study and also vertical: has response info (see code) and all stimuli saved in cells (easier and faster to read in than to do separately for each subject) (ruesseler-eeg-analysis: behaviouralAnalysis: function: *read\_in\_behav\_data\_with\_new\_response\_matrix.m*) * **preprocessedData/behaviour/behav\_data\_all\_subjs\_all3.mat** contains behavioural data for 28 subjects who completed the main task; 24 for whom EEG data was successfully acquired and a further 4 participants for whom there were technical issues with the data acquisition. The naming conventions of the different variables provided in these two data files are given in ***Appendix A***. * **preprocessedData/behaviour/behav\_data\_all\_subjs\_allVertical.mat** contains behavioural data for the 6 subjects who completed the task with simultaneous vertical and horizontal dot motion stimuli that were superimposed on one another. The naming conventions for these variables are similarly given in ***Appendix A***. * EEG: Folder for each subject with spm files containing raw eeg data for each session for LMRM = left mastoid/right mastoid as reference, downsampled to 100Hz. There are additional preprocessing steps that can be run. (ruesseler-eeg-analysis preprocessing functions: *EyeblinkCopy\_of\_run\_preprocessing\_for\_all\_subjects*) * **preprocessedData/[subjID]/LMRM/Mdspmeeg\_[subjID]\_sess00X\_eeg.mat** contains the EEG data for subject **[subjID]** for session **[X]** (of 6 sessions). This file is in SPM12 format, and has a partner **[.dat]** file with the same filename (all SPM12 files consist of a header .mat file and a data .dat file). The EEG data in this file is after minimal pre-processing has been performed (conversion to SPM12 format, downsampling to 100Hz, and re-referencing of the data using *spm\_eeg\_montage* to a left mastoid/right mastoid reference (hence **[LMRM]** is the folder name)). If you want to perform any analysis with the raw data, we suggest that you use this file (virtually any analysis can be performed with this file, except looking at high-frequency EEG responses). Note that the naming convention Mdspmeeg\_ refers to the fact that the file is in SPM format, and has been downsampled and montaged. Details of the structure of these .mat and .dat files can be understood by referencing the SPM12 manual, available at [https://www.fil.ion.ucl.ac.uk/spm/](https://www.fil.ion.ucl.ac.uk/spm/) * Please note: we also have stored versions of SPM12 files from the different stages of preprocessing, *en route* from the raw downsampled EEG data to the results from the convolutional GLM analyses (see next point). These intermediate preprocessing files are quite large (\~193GB), and so are ***not*** included in this repository. It should be possible to recreate them with the code and the methods from the paper, but please contact us directly if you think you need any of our copies of the intermediate preprocessing stages of the data. 2. convGLM * **convGLM/matchedEegData/LMRM/[subjID]\_EEGdat.mat** are files in MATLAB format, with EEG data matched to stimulus stream (for processing information, look in ruesseler-eeg-analysis repository for: *run\_match\_of\_eeg\_and\_stimulus\_for\_all\_subjects.m*). Note that these include two datafiles for each subject, both before and after current source density analysis (CSD) - the latter is **[subjID]\_csdEEGdat.mat**. The naming conventions for these variables are similarly given in ***Appendix B***. * **convGLM/betasGLMData/LMRM/[subjID]\_[model\_name].mat** are files in MATLAB format that contain the betas for each subject for a range of different convolutional GLMs that have been applied to the data (for details of the different models, look in ruesseler-eeg-analysis for: *run\_convolutional\_GLM\_for\_all\_subjects.m*). The naming conventions for these variables are similarly given in ***Appendix C***. 3. conventionalEEG analysis * **conventionalEEGAnalysis/LMRM/[epoching\_type]\_[subjID].mat** EEG data that have been epoched into trials, either locked to trial start or response, and with/without CSD transform applied (for the different types of epoching, look in ruesseler-eeg-analysis for: *all\_subjects\_create\_single\_trial\_data.m*). The naming conventions for these variables are similarly given in ***Appendix D***. * Note that the folder *averageReference* is intentionally empty, as we only include data that has been re-referenced to a left mastoid/right mastoid reference in this repository (hence the 'LMRM' naming convention throughout). 4. Raw data -- ***removed from this repository.*** * Please note: the *raw* data before conversion to SPM format have been removed from this repository, as Dryad has an upper limit of 300GB per repository. Most analyses should instead be possible with the "lightly preprocessed" data (see point 1), and certainly all analyses that were included in the paper. Please contact us directly if you think you need access to the *raw* data (\~560GB). * Training: folder for each subject with stim and behavioural folders * Experiment: folder for each subject and subfolders for stim (MATLAB format), behaviour (MATLAB), eeg (Curry format), eye (Eyelink) **Maria Ruesseler ([maria.ruesseler@gmail.com](mailto:maria.ruesseler@gmail.com)) and Laurence Hunt ([laurence.hunt@psy.ox.ac.uk](mailto:laurence.hunt@psy.ox.ac.uk))** <br> *** ## Appendix A: Structure of behavioural data files The following variables are stored in the matlab files: **preprocessedData/behaviour/behav\_data\_all\_subjs\_all3.mat** and **preprocessedData/behaviour/behav\_data\_all\_subjs\_allVertical.mat** ### "All\_responses" variable *all\_responses* is a large matrix of *all responses made by allsubjects* \- useful for plotting psychometric functions etc: 1 = points won on current trial or for current response (correct = +3, incorrect = -3, false alarm = -1.5, missed trial = -1.5) 2 = reaction time in secs 3 = choice: 0 left, 1 right 4 = current (mean) coherence of dots 5 = choice: correct 1, incorrect 0 6 = frame on which response occured (for *missed* responses: 500ms after the end of response period) 7 = flag for *type* of response: * 0: incorrect response during coherent motion, * 1: for correct response during coherent motion, * 2: response during incoherent motion, * 3: missed response to coherent motion 8 = total number of trials per block 9 = block ID (which of 4 blocks was currently being completed) * 1: frequent and short response periods * 2: frequent and long response periods * 3: rare and short response periods * 4: rare and long response periods 10 = session id (which of 6 sessions (each session consisted of 4 blocks)) 11 = subject number (running number, starting with 1, used for indexing) 12 = subject ID. Corresponds to *subject ID* column in **participantInfo.xlsx** ### "Streams" variables Variables ending in *streams* are cell arrays indexed with {*subject,session*}(:,*block*). (Note that *subject* here = running subject number (i.e. column 11 in *all\_responses*)) * *stim\_streams:* the actual coherence that participants saw on each frame * *stim\_streams\_org:* what was created before the experimental session-- compare to *stim\_streams*, below * *stim\_streams*: trial periods have been filled with noise after a response is made and the participant detected a trial (and thus contain the actual coherence the participant was exposed to) * *mean\_stim\_streams:* has the mean coherence with which the stimulus was created (0 for baseline periods, 0.3,0.4,0.5 for trials) * *mean\_stim\_streams\_org:* same distinction as for *stim\_streams* * *noise\_streams:* a stream of coherences generated with a mean coherence of 0 over the whole block (used to fill up remaining trial time during the experiment) * *trigger\_streams:* stream of triggers that were attempted to be sent at each frame for EEG recording (not relevant for behavioural analysis) n.b. for all *streams* variables (except *trigger\_streams*): values &gt;1 are set to 1 and values &lt;-1 are set to -1 (as motion coherence can't be greater(smaller) than 1 (-1). Note that stimulus was presented at 100Hz, in blocks of 5min --&gt; \~30,000 frames/block. <br> *** ## Appendix B: Structure of files with EEG data matched to stimulus stream The following two variables are stored in the files **convGLM/matchedEegData/LMRM/[subjID]\_EEGdat.mat:** * *EEGdat{sessionID}{blockID}*: each of these cells contains a channels\*time matrix of EEG data, after the triggers have been matched so that the EEG data corresponds to the same samples in the stimulus streams * *badSamples{sessionID}{blockID}*: each of these cells contains a channels\*time logical index of whether the channel is marked as **bad** in preprocessing (1) or not (0) <br> *** ## Appendix C: Structure of files with betas from convolutional GLM The following variables are stored in the files **convGLM/betasGLMData/LMRM/[subjID]\_[model\_name].mat:** * betas\_subject{regressorNumber}: each of these cells contains a four-dimensional matrix with regression coefficients from the corresponding model fit: dimensions nChannels\*nPeriEventTimepoints\*nSessions\*nBlocks. The ordering of the betas is given by *continuous\_RDK\_set\_options*, which is called by *run\_convolutional\_GLM\_for\_all\_subjects.m* in *ruesseler-eeg-analysis* * chanlabels{channelNumber}: each of these cells contains the label for each of the EEG channels, using 10-20 convention *** ## Appendix D: Structure of files with conventionally epoched EEG data The following variables are stored in the files **conventionalEEGAnalysis/LMRM/[epoching\_type]\_[subjID].mat** * dataAppend: a structure containing epoched data, stored in *FieldTrip* format, for exploratory epoch-based analyses. For details of FieldTrip format visit https://www.fieldtriptoolbox.org
description: During perceptual decision-making tasks, centroparietal EEG potentials
 report an evidence accumulation-to-bound process that is time locked to
 trial onset. However, decisions in real-world environments are rarely
 confined to discrete trials; they instead unfold continuously, with
 accumulation of time-varying evidence being recency-weighted towards its
 immediate past. The neural mechanisms supporting recency-weighted
 continuous decision making remain unclear. Here, we use a novel continuous
 task design to study how the Centroparietal Positivity (CPP) adapts to
 different environments that place different constraints on evidence
 accumulation. We show that adaptations in evidence weighting to these
 different environments are reflected in changes in the CPP. The CPP
 becomes more sensitive to fluctuations in sensory evidence when large
 shifts in evidence are less frequent, and the potential is primarily
 sensitive to fluctuations in decision-relevant (not decision-irrelevant)
 sensory input. A complementary triphasic component over occipito-parietal
 cortex encodes the sum of recently accumulated sensory evidence, and its
 magnitude covaries with parameters describing how different individuals
 integrate sensory evidence over time. A computational model based on leaky
 evidence accumulation suggests these findings can be accounted for by a
 shift in decision threshold between different environments, which is also
 reflected in the magnitude of pre-decision EEG activity. Our findings
 reveal how adaptations in EEG responses reflect flexibility in evidence
 accumulation to the statistics of dynamic sensory environments. 
description: Full details of dataset collection and preprocessing steps are
 provided in the associated manuscript (Ruesseler/Weber et al., bioRxiv
 2023).
description: The relevant code to analyse this data is stored at our online
 code repository, https://github.com/CCNHuntLab/ruesseler-eeg-analysis.  Further information and usage notes for this repository are given in the associated README document with this dataset.