Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com), Millisecond
Created: February 14, 2018
Last Modified: June 04, 2026 by K. Borchert (katjab@millisecond.com), Millisecond
Script Copyright © Millisecond Software, LLC
This script implements a 'Four Armed Bandit Task'; a paradigm to study the conflict between the opposing demands of gathering new information and exploiting known information to maximize profits in human decision making. The implemented procedure is similar to the one described in Daw et al (2006).
Daw, N.D., O'Doherty, J.P., Dayan, P., Seymour, B. & Dolan, R.J. (2006). Cortical substrates for exploratory decisions in humans. Nature. 2006 June 15; 441(7095): 876–879. and Supplemental Materials (Refer to Web version on PubMed Central for supplementary material)
30 minutes
Participants have to choose between four slots that are each tied to different payoffs. The payoffs of each slot fluctuate from trial to trial. Specifically, the payoffs for each slot are drawn from a Gaussian distribution (standard deviation = 4) around mean M, rounded to the nearest integer (enforced range 1-100). At the beginning of each selection trial, the mean for each slot diffuses in a decaying Gaussian random walk and the new payoffs are drawn from their respective (updated) distributions (Daw et al, 2006). Participants are instructed to maximize their payoffs. Participants use keyboard keys to make their choice.
provided by Millisecond - can be edited under section Editable Stimuli
provided by Millisecond (not original to Daw et al, 2006)- can be edited under section Editable Instructions
• main instructions are provided via *.htm files. To edit instructions replace existing htm files or edit
provided ones using simple text editors such as Notepad (win) or TextEdit (Mac)
Edit in script fourarmedbandittask_instructions_inc.iqjs
File Name: fourarmedbandittask_summary*.iqdat
| Name | Description |
|---|---|
| startDate | Date the session was run |
| startTime | Time the session was run |
| subjectId | Participant ID |
| groupId | Group number |
| sessionId | Session number |
| elapsedTime | Session duration in ms |
| inquisit.version | Inquisit version number |
| computer.platform | Device platform: win | mac |ios | android |
| computer.touch | 0 = device has no touchscreen capabilities; 1 = device has touchscreen capabilities |
| computer.hasKeyboard | 0 = no external keyboard detected; 1 = external keyboard detected |
| completed | 0 = Test was not completed 1 = Test was completed |
| maxPayout | The maximum payout that would have been possible by choosing the highest payoff every trial |
| total | Total payout (sum of all trial payouts) -> absolute Reward Maximation |
| propTotal | Proportion total/maxTotal -> relative Reward Maximation |
| regret | The difference btw 'maxTotal - total' (Ideal-Reality) |
| totalTrialCount | Number of test trials run across rounds |
| noResponseCount | Number of test trials where no selection was made (in time) across rounds |
| propNoResponses | Proportion no responses (no choice was made) |
| propHighestPayOff | Proportion highest payOff option selected (of all trials in which a choice was made); measure of 'Optimal Choice Making' |
| propExploitative | Proportion exploitative choices (of all trials in which a choice was made) 'exploitative' selection (in this script) participant selected the slot with the highest known payoff at this point |
| propExplorative | Proportion of choices spent on trying new slots; measure of exploration rate |
File Name: fourarmedbandittask_raw*.iqdat
| Name | Description |
|---|---|
| date | Date the session was run |
| time | Time the session was run |
| subject | Participant ID |
| group | Group number |
| session | Session number |
| build | Inquisit version number |
| computer.platform | Device platform: win | mac |ios | android |
| computer.touch | 0 = device has no touchscreen capabilities; 1 = device has touchscreen capabilities |
| computer.hasKeyboard | 0 = no external keyboard detected; 1 = external keyboard detected |
| blockcode | The name the current block (built-in Inquisit variable) |
| blocknum | The number of the current block (built-in Inquisit variable) |
| trialcode | The name of the currently recorded trial (built-in Inquisit variable) |
| trialnum | The number of the currently recorded trial (built-in Inquisit variable) trialnum is a built-in Inquisit variable; it counts all trials run even those that do not store data to the data file. |
| countRounds | Counts the number of rounds played |
| totalTrialCount | Running count of all test trials run across rounds |
| trialCountPerRound | Running count of test trials per round |
| noResponseCount | Running count of all test trials where no selection was made (in time) across rounds |
| response | The participant's response => trial.selection: the selected slot ('slot1' (red), 'slot2' (green), 'slot3' (blue), 'slot4' (yellow) ) |
| latency | The response latency (in ms); measured from |
| selectionRT | The latency (ms) of selecting the current slot; measured from onset of all four 'slots' |
| selectedSlot | The selected slot: 1, 2, 3, 4 |
| choice | 0 = no selection made (timed-out) 1 = exploitative selection made (participant selected the slot with the highest known payoff at this point) 2 = exploratory selection (participant selected an slot that did not have the highest known payoff at this point) choice is determined in 'trial.selection' based on the last known payoffs seen before making the choice |
| currentHighestSeenPayOffSlot | The slot that has the currently known highest payoff of the four options |
| currentHighestSeenPayOff | The currently known highest payoff Note trial.selection stores the value that is known when the selection is made (but before the result has been revealed) trial.iti stores the potentially updated value that is known at the end of the trial |
| lastSeenPayOff1 | Stores the last seen payOff for 'slot1' |
| lastSeenPayOff2 | Stores the last seen payOff for 'slot2' |
| lastSeenPayOff3 | Stores the last seen payOff for 'slot3' |
| lastSeenPayOff | Stores the last seen payOff for 'slot4' currenthighestSeenPayOff is calculated as the highest of these 4 values all 'lastSeenPayOffs' are updated at the END of each trial sequence trial.selection: stores the known payOffs at the start of the trial sequence trial.iti: stores the known payOffs at the end of the trial sequence |
| maxTotal | The maximum number of points that could have been won at this point |
| total | The total points won |
| regret | The difference btw 'maxTotal - total' |
| currentPayoff | Stores the current payoff 'paid' based on the selected slot |
| highestPayOffSelected | 1 = the slot with the currently highest payoff was selected 2 = a slot with a lesser payoff was selected 0 = no choice was made at time of making their choice, participants were not aware of any potential changes in relative payoffs. |
| currentHighestPayOffSlot | The slot with the currently highest payoff (is not necessarily known by player) |
| payOff1 | Current payoff for selecting 'slot1' |
| payOff2 | Current payoff for selecting 'slot2' |
| payOff3 | Current payoff for selecting 'slot3' |
| payOff4 | Current payoff for selecting 'slot4' |
| mean | Helper variable to calculate the current means for the four slots |
| mean1 | The current mean payoff for 'slot1'; used to calculate payoff1 |
| mean2 | The current mean payoff for 'slot2'; used to calculate payoff2 |
| mean3 | The current mean payoff for 'slot3'; used to calculate payoff3 |
| mean4 | The current mean payoff for 'slot4'; used to calculate payoff4 |
The procedure can be adjusted by setting the following parameters.
| Name | Description | Default |
|---|---|---|
Design Parameters |
||
| skipTotal | True (1): the total points won are NOT presented on screen false (0): the total points won are presented on screen | true |
| numberOfTestTrialsGame | Number of test trials | 150 |
| countRounds | Number of rounds to play | 2 |
| startMean1 | The first mean value to use to calculate payoffs for the first trial | 20 |
| startMean2 | The second mean value to use to calculate payoffs for the first trial | 40 |
| startMean3 | The third mean value to use to calculate payoffs for the first trial | 60 |
| startMean4 | The fourth mean value to use to calculate payoffs for the first trial these means are randomly assigned to 'slot1'-'slot4' | 80 |
Sizing Parameters |
||
| slotSize | The proportional size of the four 'slots' (proportional to canvas) | 35% |
Timing Parameters |
||
| selectionTimeout | The response timeout (in ms) for making a choice | 1500 |
| timeoutWarningDuration | 4200:the duration (in ms) of the red X to signal a no response timeout | |
| animationDuration | The duration (in ms) of the animated slot (the wait time until result is revealed) | 2000 |
| outcomeDuration | The duration (in ms) of the result (the reveal of the points won) | 1000 |
| iti | The intertrial interval in ms in this script, the iti is fixed (compare to: Daw et al, 2006, Supplementary Methods) | 2000 |
| breakDuration | Btw. round rest duration (in ms) | 60000 |
| readyDuration | 'get ready' duration (in ms) | 2000 |
Reponsekeys |
||
| slot1TopLeftKey | Slot1 key | "E" |
| slot2TopRightKey | Slot2 key | "I" |
| slot3BottomRightKey | Slot3 key | "M" |
| slot4BottomLeftKey | Slot4 key | "C" |