I’m considering using PsychoPy to make an experiment currently coded in Matlab available for online deployment via Mturk or similar. Before I invest the time getting to know PsychoPy, I was hoping to confirm whether what I want to build is doable.
I need to have the visual stimuli (*5) presented to participants drawn from a gaussian distribution. Then allow participants to move a line indicating their response to the midpoint of the five presented stimuli and capture the position of their response…
What does that mean? i.e. it is not clear how visual stimulus objects can be drawn from a continuous gaussian distribution. Presumably you mean some scalar continuous aspect of the stimuli (like position or opacity or something)?
Yes, just the x-value of the stimuli is drawn randomly. Actually the way it works is that x-value of a hidden ‘coin’ is drawn from one gaussian, then the x-value of the five blue splashes are drawn from another gaussian centred on the x-value of the hidden coin.
PsychoPy bundles the numpy package, which gives access to a variety of statistical functions. For example, you could do this in the “begin experiment” tab of a code component:
from numpy.random import normal
and then have access to that function in other parts of your experiment, e.g. get a random location like:
x = normal(loc = 0, scale = 50)
to get a position centred on 0 and with a standard deviation of 50 pixels. See the numpy documentation here:
The standard numpy.random.random() function (that Builder imports as random()) draws from a uniform distribution, so you need to import the more specialised normal function yourself.