Developer Reference

  • 2020.2
  • 07/15/2020
  • Public Content
Contents

vRngGamma

Generates gamma distributed random values.

Syntax

status
=
vsrnggamma
(
method
,
stream
,
n
,
r
,
alpha
,
a
,
beta
)
status
=
vdrnggamma
(
method
,
stream
,
n
,
r
,
alpha
,
a
,
beta
)
Include Files
  • mkl.fi
    ,
    mkl_vsl.f90
Input Parameters
Name
Type
Description
method
INTEGER
,
INTENT(IN)
Generation method. The specific values are as follows:
VSL_RNG_METHOD_GAMMA_GNORM
VSL_RNG_METHOD_GAMMA_GNORM_ACCURATE
Acceptance/rejection method using random numbers with Gaussian distribution.
See brief description of the method
GNORM
in Table
"Values of
<
method
>
in
method
parameter"
stream
TYPE (VSL_STREAM_STATE)
,
INTENT(IN)
Descriptor of the stream state structure
n
INTEGER
,
INTENT(IN)
Number of random values to be generated
alpha
DOUBLE PRECISION
for
vdrnggamma
REAL
(KIND=4)
,
INTENT(IN)
for
vsrnggamma
REAL
(KIND=8)
,
INTENT(IN)
for
vdrnggamma
Shape
α
.
a
DOUBLE PRECISION
for
vdrnggamma
REAL
(KIND=4)
,
INTENT(IN)
for
vsrnggamma
REAL
(KIND=8)
,
INTENT(IN)
for
vdrnggamma
Displacement
a
.
beta
DOUBLE PRECISION
for
vdrnggamma
REAL
(KIND=4)
,
INTENT(IN)
for
vsrnggamma
REAL
(KIND=8)
,
INTENT(IN)
for
vdrnggamma
Scalefactor
β
.
Output Parameters
Name
Type
Description
r
DOUBLE PRECISION
for
vdrnggamma
REAL
(KIND=4)
,
INTENT(OUT)
for
vsrnggamma
REAL
(KIND=8)
,
INTENT(OUT)
for
vdrnggamma
Vector of
n
random numbers with gamma distribution
Description
The
vRngGamma
function generates random numbers with gamma distribution that has shape parameter
α
, displacement
a
, and scale parameter
β
, where
α
,
β
, and
a
R
;
α
> 0,
β
> 0
.
The probability density function is given by:
Equation
where
Γ
(
α
) is the complete gamma function.
The cumulative distribution function is as follows:
Equation