Hi there,
I am working on a 2-AFCT experiment that will present masked stimuli at different discrimination threshold levels. For that, my intention is to use the PsychoPy implementation of the QUEST+ staircase to estimate the stimulus intensity thresholds. Following this example on GitHub (QuestPlusHandler freezes at trial 28 when `.next()` mehtod is called · Issue #4305 · psychopy/psychopy · GitHub) I have managed to fit the QUEST+ with my experimental parameters and everything seems working fine. However, I’ve have noticed that the staircase doesn’t update the stimulus intensity from trial to trial (from the 2nd trial on, the stimulus intensity remains at 0.1). I would appreciate if you could help me with this issue and if you could indicate me more examples of the quest+ implementation.
Find below the experiment parameters that I am using, the quest+ initialisation and update code, and the trial-by-trial output from 5 trials. I am also attaching the experiment file.
discrimination.py (40.3 KB)
Before experiment (out from the trial loop): Parameter selection and staircase initialisation code:
#Parameters
n_trials = 20
min_opacity = 0.10
max_opacity = 0.98
opacities = np.arange(min_opacity, max_opacity, 0.02)
thresh = [0.5, 0.6, 0.75]
slopes = [.2,.4,.6,.8]
lapses = 0.02
#Initialize quest+
staircase = data.QuestPlusHandler(
nTrials=n_trials, intensityVals=opacities, thresholdVals=thresh,
slopeVals=slopes, lowerAsymptoteVals=[0.5], lapseRateVals=lapses,
responseVals=[1, 0], startIntensity=opacities[30],
stimScale='linear')
Beginning of the trial (within trial loop): obtain stimulus intensity
#Define stimulus intensity
intensity = staircase.next()
End of the trial (within trial loop): update staircase based on new response
#Update staircase with discrimination accuracy
staircase.addResponse(discrimination_acc)
Trial-by-trial outputs from the experiment:
##############################################
This is trial: 1
Stimulus intensity = 0.7000000000000001
The correct response and the real response:
right
right
Discrimination accuracy: 1
Estimated params: {‘threshold’: 0.6148373497289881, ‘slope’: 0.5014992625625008, ‘lowerAsymptote’: 0.5, ‘lapseRate’: 0.02}
##############################################
##############################################
This is trial: 2
Stimulus intensity = 0.1
The correct response and the real response:
left
left
Discrimination accuracy: 1
Estimated params: {‘threshold’: 0.6134297428438651, ‘slope’: 0.48409639875229654, ‘lowerAsymptote’: 0.5000000000000001, ‘lapseRate’: 0.020000000000000004}
##############################################
##############################################
This is trial: 3
Stimulus intensity = 0.1
The correct response and the real response:
left
right
Discrimination accuracy: 0
Estimated params: {‘threshold’: 0.6161327056935246, ‘slope’: 0.5194434311373103, ‘lowerAsymptote’: 0.5, ‘lapseRate’: 0.02}
##############################################
##############################################
This is trial: 4
Stimulus intensity = 0.1
The correct response and the real response:
left
left
Discrimination accuracy: 1
Estimated params: {‘threshold’: 0.6146928135777328, ‘slope’: 0.5023949691144339, ‘lowerAsymptote’: 0.5, ‘lapseRate’: 0.02}
##############################################
##############################################
This is trial: 5
Stimulus intensity = 0.1
The correct response and the real response:
right
right
Discrimination accuracy: 1
Estimated params: {‘threshold’: 0.6133294075194875, ‘slope’: 0.48522153761727616, ‘lowerAsymptote’: 0.5, ‘lapseRate’: 0.02}