Python Forum
QuestHandler: pTreshold & StartValSd
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QuestHandler: pTreshold & StartValSd
#1
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. And how could I make sure the opacity of the target is adapted in such a way that the accuracy is 70%: what parameters of the QuestHandler define the accuracy, what output of the questhandler should I use (mean, mode or quantile) and is the QuestHandler appropriate for the goal of my script?

Thanks in advance.

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])
buran write Nov-29-2020, 03:07 PM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020