comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: A question about Gaussian distributions in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: A question about Gaussian distributions in IDL [message #44615] Thu, 30 June 2005 17:53
ntigris@gmail.com is currently offline  ntigris@gmail.com
Messages: 6
Registered: July 2005
Junior Member
Thanks!
Re: A question about Gaussian distributions in IDL [message #44634 is a reply to message #44615] Wed, 29 June 2005 23:15 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
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
Re: A question about Gaussian distributions in IDL [message #44636 is a reply to message #44634] Wed, 29 June 2005 19:14 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: mnf and masks
Next Topic: Re: how to stop a procedure in idlwave

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 11:53:31 PDT 2025

Total time taken to generate the page: 1.68599 seconds