This script generates random numbers along a Normal or Log-normal distribution using the Marsaglia polar method.
normalRandom
: Generate random numbers that follow a Normal distribution.normalRandomInRange
: Generate random numbers that follow a Normal distribution but are clipped to fit within a rangenormalRandomScaled
: Generate random numbers that follow a Normal distribution with a given mean and standard deviationlnRandomScaled
: Generate random numbers that follow a Log-normal distribution with a given geometric mean and geometric standard deviation
Hi. I tested the normalRandomScaled() function and found it doesn't return a normal distribution with the specified standard deviation. I created sample sizes of 59 with a mean of 1752 and sd of 85 and returned distributions had sd's of around 6.
Kind regards,
Chris