XLPack 7.0
XLPack Numerical Library (Excel VBA) Reference Manual
Loading...
Searching...
No Matches

◆ Drand48Gam()

Function Drand48Gam ( Optional Alpha As  Double = 1,
Optional Beta As  Double = 1 
)

48 bit real gamma random number (Squeeze method of Marsaglia and Tsang) (Linear congruential method)

Purpose
Generates random numbers following gamma distribution Γ(α, β).
An uniform random number is generated by the random number generator Drand48() which is based on the linear congruential method. Then it is transformed to the gamma random number by the squeeze method of Marsaglia and Tsang.
Returns
Double
48 bit real gamma random number.
If Alpha or Beta is not valid, 0 will be returned.
Parameters
[in]Alpha(Optional)
The shape parameter α of the gamma distribution Γ(α, β). (α > 0) (default = 1)
[in]Beta(Optional)
The rate parameter β of the gamma distribution Γ(α, β). (β > 0) (default = 1)
Note
Same as using Drand48(). See Drand48() for more details.
Reference
(Japanese book) Yatsuji Tetsuaki, "Probability distribution random number generation method" 2nd ed., Pleiades Publishing, 2019.