psychopy.org | Reference | Downloads | Github

Problem with QuestHandler: pTreshold & StartValSd

Hi,

I am trying to construct my first experiment using the QuestHandler and ran into some problems. A simple description of the experiment is as followed: participants have to detect a small target inside a grating. A staircase procedure (using the questhandler) is used to adapt the opacity of the target. The goal is to make sure participants have an accuracy of 70%. I wanted to use the QuestHandler implemented in psychopy, however when testing the effects of adapting the pTreshold & StartValSd I ran into some problems. I thought the pTreshold defined the goal-accuracy, however this seems not to be the case: I wrote a short script that uses a fixed response-array to test first the difference in the staircase._nextIntensity with different pTresholds, next with different StartValSds. Weirdly, the staircase output is exactly the same when using different pTresholds.
Is it not correct that the pTreshold defines the goal-accuracy and how can I create an accuracy of 70%? The test-script is added below.

Thanks in advance.
Maud

Test-script:
from psychopy import visual, data, event, core, gui
import numpy as np

n_trials = 84
n_blocks = 2
Opa_array = np.empty([n_blocks, int(n_trials/2)])

responses = np.concatenate([np.ones(35), np.zeros(42-35)])
responses = responses.astype(int)
np.random.shuffle(responses)

#%%Test differences in Tresholds
Tresholds = np.array([0.60, 0.70])
for block in range(n_blocks):
Tres = Tresholds[block]
staircase1 = data.QuestHandler(startVal = 0.25, startValSd = 0.15, nTrials = n_trials/2,
pTreshold = Tres)
for i in range(int(n_trials/2)):
Opa_array[block, i] = staircase1._nextIntensity
resp = responses[i]
staircase1.addResponse(resp)
print(‘The staircase output with pTreshold = {}’.format(Tres))
print(staircase1.mode(), staircase1.quantile())

print(‘StartValSd = {0}; pTreshold = {1}’.format(staircase1.startValSd, Tresholds))
print(‘Difference between the 2 created intensity_arrays’)
print(Opa_array[0] - Opa_array[1])

#%% Test differences in StartValSd
StartVals = np.array([0.15, 0.25])
for block in range(n_blocks):
Tres = 0.7
StartVal = StartVals[block]
staircase1 = data.QuestHandler(startVal = 0.25, startValSd = StartVal, nTrials = n_trials/2,
pTreshold = Tres)
for i in range(int(n_trials/2)):
Opa_array[block, i] = staircase1._nextIntensity
resp = responses[i]
staircase1.addResponse(resp)
print(‘The staircase output with StartValSD = {}’.format(StartVal))
print(staircase1.mode(), staircase1.quantile())

print(‘StartValSd = {0}; pTreshold = {1}’.format(StartVals, Tres))
print(‘Difference between the 2 created intensity_arrays’)
print(Opa_array[1] - Opa_array[0])