Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Re: A question about Gaussian distributions in IDL
In article <1120080420.668477.173460@z14g2000cwz.googlegroups.com>, "ntigris@gmail.com" <ntigris@gmail.com> wrote: > Hello, > > IDL's RANDOMN function creates a normal distribution with a mean of 0 > and a variance of 1. I need a variance other than one. Is there a > simple way to obtain such a distribution in IDL? > > Thanks a lot! Multiply the result of RANDOMN by the desired standard deviation. Cheers, Ken Bowman IDL> n = 100000 IDL> x = RANDOMN(seed, n) IDL> print, stdev(x) 1.00107 IDL> var = 9.0 IDL> std = sqrt(var) IDL> print, stdev(std*x) 3.00322 IDL> print, variance(std*x) % Compiled module: VARIANCE. % Compiled module: MOMENT. 9.01934
ntigris@gmail.com wrote: > IDL's RANDOMN function creates a normal distribution with a mean of 0 > and a variance of 1. I need a variance other than one. Is there a > simple way to obtain such a distribution in IDL? Here is an article: http://www.dfanning.com/math_tips/normsigma.html Cheers, David