Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] Presenting stimuli at different frequencies

edited December 2011 in OpenSesame

Hi Sebastiaan,

The stimuli that I wish to present needs to follow the normal curve, and so some stimuli will be presented, randomly, more frequently than others during the loop. For example, say I have 10 experimental stimuli whose frequencies are as follows

1 -> 1
2 -> 2
3 -> 3
4 -> 4
5 -> 5
6 -> 5
7 -> 4
8 -> 3
9 -> 2
10 - > 1

So here there would be 30 cycles in the loop, though not every stimulus is presented the same number of times. How can I make it so each stimulus is presented a specific number of times during the loop? I realise that I could simply input the stimuli individually under the variable name, but the experiment I am running has far more stimuli and requires at least 200 cycles per loop. I was wondering if there was an easier way to achieve this?

Kind Regards

Rob

Comments

  • edited 3:41PM

    Hi Rob,

    There is. As you say, for a low number of stimuli, it's probably better to manually create a list, but ...

    Method 1

    ... for a large nr of stimuli you could draw a number from a gaussian distribution. You could do this by inserting an inline_script at the start of the trial, with (something like) the following code in the prepare phase.

    import random
    nr = round(random.gauss(5, 1)) # Mean = 5, Stdev = 1
    self.experiment.set('my_random_number', nr)

    See http://docs.python.org/library/random.html#random.gauss

    Method 2

    This has the disadvantage that you cannot control exactly how often each number occurs (although for a large number of trials this probably doesn't matter). If you want exact control, you could add an inline_script to the start of the experiment, with (something like) the following code in the run phase:

    import random
    self.experiment.nr_list = []
    self.experiment.nr_list += [1]*5
    self.experiment.nr_list += [2]*10
    self.experiment.nr_list += [3]*5
    random.shuffle(self.experiment.nr_list)

    This generates a randomly ordered list of numbers, where '1' occurs 5 times, '2' occurs 10 times, etc. To draw a number from this list on every trial, add an inline_script at the start of the trial, with (something like) the following code in the prepare phase:

    nr = self.experiment.nr_list.pop()
    self.experiment.set('my_random_number', nr)

    Hope this helps!

    Sebastiaan

  • edited 3:41PM

    Hi Sebastiaan
    Sorry for my delayed reply, and thank you for your help. That helps greatly!
    Great support!
    Cheers,
    Rob

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games