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

Home » Public Forums » archive » Re: gamma random numbers ?
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: gamma random numbers ? [message #30730] Wed, 15 May 2002 15:43 Go to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
hkc@ariel.met.tamu.edu (hkc) writes:

> i tried to make a gamma random numbers generator with two variables,
> shape and scale parameters.
> my simple idea is to use a uniformly distributed random number
> generators in IDL.
> then the probability of each bins is set to be distribuited by gamma
> functions.
> it means that inside of each bins, data are distributed uniformly,
> but overall probability is distributed by gamma.
> do you think it is O.K.?
> please let me know if you have any ides for this.
> thanks

This is the second time you have asked the same question, but I made a
response the first time. I'll assume you missed it. Or, did this
response not help?

Craig Markwardt writes:
>
> I think you just multiply the deviate by the scale parameter, right?
>
> See beautiful on-line book here:
> http://www.itl.nist.gov/div898/handbook/eda/section3/eda366b .htm

I.e.,

r = randomu(seed, gamma=SHAPE)*SCALE

Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: gamma random numbers ? [message #30814 is a reply to message #30730] Thu, 16 May 2002 08:30 Go to previous message
Andrew Loughe is currently offline  Andrew Loughe
Messages: 9
Registered: October 1998
Junior Member
I would add to Craig's response an assignment to "seed"
that looks something like this:

seed = long((systime(1) - long(systime(1))) * 1.e6)

> r = randomu(seed, gamma=SHAPE)*SCALE


--
Andrew Loughe =====================================================
NOAA/OAR/FSL/AD R/FS5 | email: Andrew.Loughe@noaa.gov
325 Broadway | wwweb: www-ad.fsl.noaa.gov/users/loughe
Boulder, CO 80305-3328 | phone: 303-497-6211 fax: 303-497-6301
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: resizing idlde editor windows? (was: Re: how i can detect round bright structures in picture??)
Next Topic: Re: reversing [near, far] for volume rendering

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

Current Time: Thu Oct 09 06:57:27 PDT 2025

Total time taken to generate the page: 0.16181 seconds