Return to the Probabilistic Reward Task page
															
___________________________________________________________________________________________________________________	

										*PROBABILISTIC REWARD TASK*
___________________________________________________________________________________________________________________

Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 09-22-2015
last updated:  12-19-2019 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 12-19-2019 Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________	
This script implements a Probabilistic Reward Task, a simple categorization task using a differential 
reinforcement schedule of monetary reward. It can be used as a measure of reward responsiveness (hedonic capacity).

The implemented procedure is based on:

Pizzagalli, D.A., Jahn, A.L, & O'Shea, J.P. (2005). Toward an Objective Characterization of an Anhedonic
Phenotype: A Signal-Detection Approach. Biol Psychiatry, 57(4), 319–327.

___________________________________________________________________________________________________________________
TASK DESCRIPTION
___________________________________________________________________________________________________________________	
Participants are asked to categorize faces into "short" and "long" mouths. Correct responses are 
intermittedly rewarded with an asymmetric reinforcement schedule for short and long mouths.
For half the participants short mouths get reinforced about 60% of the times ("frequent reward") 
whereas long mouths get reinforced only about 20% of the times ("infrequent reward"); 
for the other half of the participants  the reverse is true.

Responsekeys are counterbalanced within groups.
Assignment to the 4 experimental condition (2 reinforcement schedules x 2 response keys assignments) is done by
groupnumber.

___________________________________________________________________________________________________________________	
DURATION 
___________________________________________________________________________________________________________________	
the default set-up of the script takes appr. 15 minutes to complete

___________________________________________________________________________________________________________________	
DATA FILE INFORMATION 
___________________________________________________________________________________________________________________	
The default data stored in the data files are:

(1) Raw data file: 'probabilisticrewardtask_raw*.iqdat' (a separate file for each participant)

build:							The specific Inquisit version used (the 'build') that was run
computer.platform:				the platform the script was run on (win/mac/ios/android)
date, time, 						date and time script was run 
subject, group, 					with the current subject/groupnumber
script.sessionid:					with the current session id

blockcode, blocknum:				the name and number of the current block (built-in Inquisit variable)
trialcode, trialnum: 				the name and number of the currently recorded trial (built-in Inquisit variable)
										Note: trialnum is a built-in Inquisit variable; it counts all trials run; even those
										that do not store data to the data file such as feedback trials. Thus, trialnum 
										may not reflect the number of main trials run per block. 

values.expgroup:						1 = short mouth is frequently rewarded; 
									2 = long mouth is frequently rewarded
									
values.responsekeyassignment:			1 = short mouth left/long mouth right; 
									2 = short mouth right/long mouth left
									
values.blockcount:					counts the blocks

values.reward_short:					0 = short mouth trial is not supposed to be rewarded; 
									1 = short mouth trial is supposed to be rewarded 
									(if response is correct; otherwise the next short trial that is correct is rewarded)
								
values.new_reward_short:				0 = no new values.reward_short 
									(this happens if the last short mouth trial was supposed to be rewarded but response was incorrect)
									1 = a new values.reward_short needs to be determined
								
values.reward_long:					0 = long mouth trial is not supposed to be rewarded; 
									1 = long mouth trial is supposed to be rewarded 
									(if response is correct; otherwise the next log trial that is correct is rewarded)

values.new_reward_long:				0 = no new values.reward_long 
									(this happens if the last long mouth trial was supposed to be rewarded but response was incorrect)
									1 = a new values.reward_long needs to be determined

stimulusitem:							the presented stimuli in order of trial presentation
response:							the scancode of the the participant's response key:
										18 = E
										23 = I
										
values.responseCat:					the interpreted key response: "short" vs. "long"										
										
correct:								the correctness of the response (1 = correct; 0 = incorrect)

latency: 								the response latency (in ms); measured from onset of target
values.countrewardtrials:				counts the number of rewards given out (across test blocks)
values.total:							stores the currently total cents won (across test blocks)


(2) Summary data file: 'probabilisticrewardtask_summary*.iqdat' (a separate file for each participant)

computer.platform:					the platform the script was run on (win/mac/ios/android)
script.startdate:						date script was run
script.starttime:						time script was started
script.subjectid:						assigned subject id number
script.groupid:						assigned group id number
script.sessionid:						assigned session id number
script.elapsedtime:					time it took to run script (in ms); measured from onset to offset of script
script.completed:						0 = script was not completed (prematurely aborted); 
									1 = script was completed (all conditions run)
							
									
values.expgroup:						1 = short mouth is frequently rewarded; 
									2 = long mouth is frequently rewarded
									
values.responsekeyassignment:			1 = short mouth left/long mouth right; 
									2 = short mouth right/long mouth left

values.countrewardtrials:				counts the number of rewards given out (across test blocks)
expressions.total:						stores the currently total cents won (across test blocks)

Notes: 
responses with Latencies < 150ms OR latencies > 2500ms removed from summary statistics

expressions.propcorrect:				overall proportion correct -across all test trials-
expressions.meanRT:					overall mean response latency (in ms) of correct responses - across all test trials
propCorrect frequent:					proportion correct frequently rewarded mouth trials
expressions.meanRT_frequent:			mean latency (in ms) of correct frequently rewarded mouth trials
expressions.propcorrect_infrequent:		proportion correct infrequently rewarded mouth trials
expressions.meanRT_infrequent:		mean latency (in ms) of correct infrequently rewarded mouth trials


Note regarding logD/logB calculations: 
The counts of correct responses need to be adjusted if correct responses for frequent (infrequent) categories
are either ceiling (propCorrect = 1) or rock bottom (propCorrect = 0)
In this script, the counts get adjusted by +/- 0.0005.
If no corrections are applied in these cases, logD or logB cannot be calculated.


values.logD:							Measure of Discriminability (see Pizzagalli et al, 2005, p.5), across all testblocks
									logD is a non-parameteric alternative measure to the traditional d' measure
									of a signal detection framework. 

values.logB:							Measure of Response Bias  (see Pizzagalli et al, 2005, p.5), across all testblocks
									logB is non-parameteric alternative measure of the criterion measure 
									of a signal detection framework

									
and separate measures per test block:
values.logD_1:						
values.logB_1:
values.logD_2:						
values.logB_2:
values.logD_3:						
values.logB_3:

___________________________________________________________________________________________________________________	
EXPERIMENTAL SET-UP 
___________________________________________________________________________________________________________________

2 reward frequency schedules x 2 response key assignments: Assignment to the 4 experimental groups is done by groupnumber

group 1 (odd groupnumbers)-> short mouth faces are frequently rewarded if response is correct (potentially 30 out of 50 trials); 
long mouth faces are infrequently rewarded if correct (potentially 10 out of 50 trials)

group 2 (even groupnumbers)-> long mouth faces are frequently rewarded if response is correct (potentially 30 out of 50 trials); 
short mouth faces are infrequently rewarded if correct (potentially 10 out of 50 trials)

within those groups, response key assignments are counterbalanced


1. Practice Block: 
* a short demonstration of 2 trials
* 2 trials, 1 of short mouth faces and 1 of long mouth faces (same durations as test trials)

2. Test Blocks: 
* 3 Blocks, each block runs 100 trials (50 short mouth trials, 50 long mouth trials)
* order of short and long mouth trials is randomly determined with the constraint that 
no more than 3 consecutive runs of the same trial type
* frequently rewarded mouth trials: 30 (30/50->60%); infrequently rewarded mouth trials: 10 (10/50->20%)
	-> per block there are 40 potential reward trials 
	-> the reinforcement schedules for each trial type are randomized (see section Editable Lists for more info)
	-> if a trial has been randomly determined to be a rewarded trial but the response is incorrect, the next
	correct trial of the same trial type is rewarded instead
* there is a forced 30s (default) rest period inbetween each test block; the task continues automatically

Trial Sequence:
fixation (500ms)->No Mouth Face->(500ms)->Mouth Face(100ms)->No Mouth Face until response 
(response latency is taken and measured from onset of Mouth Face)

___________________________________________________________________________________________________________________	
STIMULI
___________________________________________________________________________________________________________________	
Face Stimuli are not original to Pizzagalli et al (2005). They can be edited under section Editable Stimuli.
(The default short mouth is about 88% of the long mouth).
Sizes of stimuli on screen are proportional to the monitor/canvas size; they can be adjusted under
section Editable Parameters.

___________________________________________________________________________________________________________________	
INSTRUCTIONS 
___________________________________________________________________________________________________________________	
Instructions are not original to Pizzagalli et al (2005). They can be edited under section Editable Instructions.
__________________________________________________________________________________________________________________	
EDITABLE CODE 
___________________________________________________________________________________________________________________	
check below for (relatively) easily editable parameters, stimuli, instructions etc. 
Keep in mind that you can use this script as a template and therefore always "mess" with the entire code to 
further customize your experiment.

The parameters you can change are:

Responsekey Assignment: see Tools -> Keyboard Scancodes
/responsekeyleft:					the scancode of the left response key (default: 18 -> E)
/responsekeyleft_label:			the label of the left response key (default: "E")
/responsekeyright:				the scancode of the right response key (default: 23 -> I)
/responsekeyright_label:			the label of the right response key (default: "I")

/fixationduration:					the duration of the fixation stim in ms (default: 500)
/signalduration:					the duration of the signal (face without mouth) before target appears in ms (default: 500)
/targetduration:					the duration of the target (face with mouth) in ms (default: 100)
/ITI:								the duration of the intertrial interval in ms (default: 0)
/feedbackduration:				the duration of the feedback stim in ms (default: 1750)
/restduration:						the duration of the rest trial inbetween blocks in ms (default: 30000)

/fixationheight:					the size of the fixation stim in % of canvas height (default: 10%)
/picsize:							the size of the face images in % of canvas size (default: 80%)
/feedbackheight:					the size of the feedback stim in % of canvas size (default: 6%)
/rewardamount:					the size of the reward in cents (default: 5)

Outlier Removal:

/minLatency:						responses with reaction times (in ms) < 150ms are not considered for summary statistics
/maxLatency:						responses with reaction times (in ms) > 2500ms are not considered for summary statistics