poisson distribution help

MEDState Notation Repository Forums Coding Help Archive poisson distribution help

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #12742
    Med_Support
    Moderator
    afern

    Hi,

     

    Does anyone know how to code a sequence of auditory stimuli with the timing of each presentation chosen from a poisson distribution?

     

    Any help would be greatly appreciated,

     

    Anushka

    #12741
    Med_Support
    Moderator
    Gary Bamberger

    Hello Anushka,

    The best way to do this is to create a LIST.  You fill this list with times until the next tone.

    Example:

    LIST Z = 20″, 30″, 30″, 40″, 40″, 40″, 50″, 50″, 50″, 50″, 60″, 60″, 60″, 60″, 60″, 70″, 70″, 70″, 70″, 80″, 80″, 80″, 90″, 90″, 100″

    If it was me I would use a program like MATLAB to come up with the numbers for the poisson distribution and then use the pre-calculated numbers to create the list.

     

    Once you have the list the next thing is to draw the Inter-Tone Times from the list.

    S.S.5,
    S1,
    #START: RANDI U = Z ---> S2
    
    S2,
    U#T: ~OnFreq(MG, BOX, 5000);~;
    RANDI U = Z ---> S2
    

     

    There are three ways to draw a value from the list.

    LIST
    Syntax:   INPUT: LIST P1 = P2(P3) —> NEXT

    When LIST is used as an Output command it will draw each number, one at a time in sequential order, until the program is done or the numbers have all been used.  If the latter occurs, LIST simply starts again at the beginning of the list.

     

    RANDD
    Syntax:   INPUT: RANDD P1 = P2 —> NEXT

    RANDD pulls numbers from a list randomly without replacement.  Think of a bucket full of numbers.  When a number is drawn from the bucket that number is now considered used and is set aside making it no longer available.  That number cannot be drawn from the bucket again until all numbers have been drawn at which point the bucket is refilled with all of the available numbers.

     

    RANDI
    Syntax:   INPUT: RANDI P1 = P2 —> NEXT

    RANDI is closely related to RANDD with the difference being in that RANDI randomly selects from an array, but with replacement.  Using the bucket analogy again, when a number is drawn from the bucket that number is immediately put back into the bucket and becomes available to be drawn again.

     

    I hope that this information helps.
    Gary

    #12745
    Med_Support
    Moderator
    afern

    Hi Gary,

     

    This is incredibly helpful. Thank you for such a prompt and detailed response. I shall try this to see how it works.

     

    Anushka

    Logged

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.