Re: [psychopy-users] Using Questhandler function to create several staircases

300 views
Skip to first unread message

Jonathan Peirce

unread,
Apr 29, 2013, 1:24:08 PM4/29/13
to psychop...@googlegroups.com
Hi Michel,

Sorry for the delay - I wanted to go and check the code in data.py and didn't have the time. I've had a look and can't see any reason in the PsychoPy code for what you're seeing. Are you certain this is something to do with the code from psychopy? e.g. if OpenSesame is generating code to control the number of trials then that might be stopping the experiment before (any of) your QUESTs finish.

Each staircase will have an attribute thisTrialN. To check that the stairs remain independent you could see what the value of all four of those is.

But honestly I suspect that opensesame is aborting after 6 trials, not the staircase. I don't know anything about how opensesame generates its psychopy code though, so can't be sure and can't help with that.

cheers,
Jon

On 23/04/2013 16:48, Michel F. wrote:
Hello,

this is my first entry, I hope to be clear and concise about my problem. Maybe you can help me with the issue I am currently stuck with.

I am running a psychophysiological experiment and I want to have 4 different conditions. Each condition should have an own staircase. Also I am using OpenSesame which is an ePrime clonewritten in python running on a psychopy backend  (dont know whether it really matters though). I used data.QuestHandler function to create four different staircases and each of them got seperate variables for defining nTrials (the amount of trials for the staircase procedure)

Here is the problem: Each time I am running my experiment, it stops at the nTrial trial. But not on the individual one but on the actual one. That is, each of the four staircases has an nTrial of e.g. 6, so in total there should be 6 * 4 trials before the experiment should stop. However, the experiment stops at the 6th trial.

staircase_high_peripheral = data.QuestHandler(high_startVal, low_startValSd, pThreshold, stepType='log',gamma = 0.01, nTrials=nTrials_high_peripheral, minVal=0.0, maxVal=1)
staircase_low_peripheral = data.QuestHandler(low_startVal, low_startValSd, pThreshold, stepType='log',gamma = 0.01, nTrials=nTrials_low_peripheral, minVal=0.0, maxVal=1)
staircase_high_distributed = data.QuestHandler(high_startVal, low_startValSd, pThreshold, stepType='log',gamma = 0.01, nTrials=nTrials_high_distributed, minVal=0.0, maxVal=1)
staircase_low_distributed = data.QuestHandler(low_startVal, low_startValSd, pThreshold, stepType='log',gamma = 0.01, nTrials=nTrials_low_distributed, minVal=0.0, maxVal=1)

It seems thus that for some reason nTrial was not defined for each staircase individually but overall even though I made several staircases (even with copy.deepcopy). I also checked, they were four different memory spots.

So I increased the nTrial to a number that could never be reached (e.g. 500) and it did not crash (obviously). However, what I found surprising was that it seemed that the staircases did in fact worked entirely independent from each other. So data that I added to one staircase had no influence on another (or did not overwrite older information/information of another staircase).

So I am a little bit confused now: Can I simply set the nTrials up to the total number of trials and ignore this, or does the nTrial problem points towards a fundamental problem of using QuestHandler with more than one staircase? Or do I totally overlook something here?

I am aware of the possibility of using MultiStairHandler, however, OpenSesame (the program I run the experiment on) is not giving the whole list of the randomized order of the conditions since it is always randomly drawn on a trial by trial basis. So implementing the variable conditions is not very straightforward.
--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/psychopy-users/-/_VMY5MMnmsUJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk



Michel F.

unread,
May 3, 2013, 4:55:47 AM5/3/13
to psychop...@googlegroups.com
Hi Jon,

thanks for the reply! Really appreciate it.

The reason why I thought that this is a psychopy resp. questhandler related problem is that the error message is basically the same error message I get according to the documentation of Questhandler when the maximum of Ntrials is reached. That is it says that there occurred a stop iteration error. So I figured maybe the variable Ntrials is a global variable and therefore if you use several single Questhandlers instead of a multistairhandler this global variable is used by each staircase which would explain why it stops working after exactly Ntrials are reached in the whole experiment rather than in each questhandler individually.
However I agree, I found it odd why the several staircases would interfere although they seem to work fine concerning the values (which they suggest with next(). However, when I looked into the .csv files I created by using saveastext the tested values as stated there did not seem to correspond with the values that were actually proposed by next(). Moreover some of the values were written down twice or up to four times in the log. Very confusing i think (?)!

Also do you suspect that this problem will be solved if I use MultiStairHandler?

I will get into contact with the guys from OpenSesame in order to find out whether it is maybe indeed an OpenSesame related problem.

Thanks!
Reply all
Reply to author
Forward
0 new messages