Running a classic oddball paradigm

Hello psychopy community!

Feels like I’m shouting into the void but might as well give it a try! I’m a grad student in applied neuroscience writing my thesis about cognitive activity during an oddball paradigm task. I am having trouble randomizing my two stimuli so that the 1 target :4 non-target ratio is fulfilled. I just end up hearing a series of sounds in chronological order without randomization. I feel like its close but still there is a crutial building setup that is missing…

There is no way for me to attach an image of the builder view here but if someone could offer some advice it would be much appreciated!

Thanks to the community and happy building,

gilo

What would this look like? Assuming X is common and Y is oddball, is the 1:4

a) strict ( 1 in every 4)

I would do foo=[ “X”, “X”, “X”, “X”, “Y” ] and then numpy.random.shuffle foo every 5th trial. This could produce Y X X X X X X X X Y chains and X X X X Y Y X X X X chains.

b) statistical (on average)

similar to a but larger scope:
x=[“X”] * 40

y=[“Y”] * 10

numpy.random.shuffle ( x+y ) after every 50 trials

c) never more than 4 X before 1 Y. Trickier.

The point is to figure out your constraints (about min and max runs of X or Y) which includes your scope (over 5 trials, or over the entire stimulus list). If there are constraints, you are best to generate your trial descriptions BEFORE running rather than on-the-fly during.

Are you using a loop pointing at a spreadsheet defining the stimulus types? If so, check it’s random, not sequential.