Gaussian Random

The random number transforms generate uniform sequences. If you want to use random numbers with Gaussian distribution instead, you must start by generating two random variables with different seeds, for example u1 and u2:
!u1! = $randS(42580)
!u2! = $randS(80191)
From these two variables, you can apply the following transform to generate a Gaussian sequence with mean 0. and std dev 1., for example g1:
!g1! = $sqrt(-2. * $ln(!u1!)) * $cos(2.* $pi * !u2!)
You can generate a second Gaussian sequence, for example g2, from the same two uniform variables:
!g2! = $sqrt(-2. * $ln(!u1!)) * $sin(2.* $pi * !u2!)
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.