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

Home » Public Forums » archive » Re: random numbers with gamma distribution
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: random numbers with gamma distribution [message #13420 is a reply to message #13416] Wed, 04 November 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
T.Osborn (f055@uea.ac.uk) writes:

> I'm trying to generate a random series that has a gamma distribution, using
> the randomu() function with the gamma keyword. The online help says to set
> gamma to an integer > 0. WHY DOES IT HAVE TO BE AN INTEGER? The gamma
> distribution is in fact defined for all gamma > 0, not just integers.
> I want to set gamma=0.5, which currently fails as it converts it to the
> integer 0, which is not > 0, and so it fails.
>
> Is this a bug, and is there any work-around?

Which gamma function are you running? Certainly not IDL's
GAMMA function which works perfectly well with non-integer
values:

IDL> print, gamma(0.5)
% Compiled module: GAMMA.
1.77245

Cheers,

David

----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438, Toll-Free Book Orders: 1-888-461-0155
Coyote's Guide to IDL Programming: http://www.dfanning.com/

Note: A copy of this article was e-mailed to the original poster.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Programs that Work on 24-bit Color Displays (Long)
Next Topic: Re: Strange UNIX or strange IDL?

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

Current Time: Sun Oct 12 03:04:19 PDT 2025

Total time taken to generate the page: 0.15978 seconds