URL of experiment: Pavlovia
Description of the problem:
I am looking to set my experiment up to run online and my x coordinate for my stimulus position values are set in a code component.
Using python code I set the x position for my two stimuli to come from two gaussians where the value of the target becomes the mean of the cue:
target_coin_position = random.gauss (mu, priorsigma)
cue_coin_position = random.gass(target_coin_position, cuesigma)
Is there an equivalent method of getting values from a Gaussian distribution in java script?
I did some research online and found randomGaussian(mu, sigma)
So I tried the java script code:
target_coin_position = randomGaussian(mu, priorsigma);
cue_coin_position = randomGaussian(target_coin_position, cue_sigma);
For this my error was:
randomGausian() is not defined- see screen shot image
I also looked into Random.nextGaussian() but I think that was for Java not Java script.
If I want this to work online is there any adjustments I could make or is this function not available to PsychoJS currently?
Could I do this process manually in java script by creating function that takes the mean (mu) and SD (sigma) as parameters and creates a normal distribution from those parameters?