|
NAG[g05ffc] NAG[nag_random_gamma] - Pseudo-random real numbers from the gamma distribution
|
|
Calling Sequence
g05ffc(a, b, x, 'n'=n, 'fail'=fail)
nag_random_gamma(. . .)
Parameters
|
a - float;
|
|
|
On entry: the argument, , of the gamma distribution.
|
|
Constraint: . .
|
|
|
b - float;
|
|
|
On entry: the argument, , of the gamma distribution.
|
|
Constraint: . .
|
|
|
x - Vector(1..n, datatype=float[8]);
|
|
|
On exit: the pseudo-random variates from the specified gamma distribution.
|
|
|
'n'=n - integer; (optional)
|
|
|
Default value: the first dimension of the array x.
|
|
On entry: the number, , of pseudo-random numbers to be generated
|
|
Constraint: . .
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_random_gamma (g05ffc) generates a vector of pseudo-random variates from a gamma distribution with arguments and .
|
|
Error Indicators and Warnings
|
|
"NE_INT_ARG_LE"
On entry, n must not be less than or equal to 0: .
"NE_REAL_ARG_LE"
On entry, a must not be less than or equal to 0.0: .
|
|
|
Examples
|
|
>
|
a := 5:
b := 1:
n := 5:
x := Vector(5, datatype=float[8]):
NAG:-g05cbc(0):
NAG:-g05ffc(a, b, x, 'n' = n):
|
|
|
See Also
|
|
Ahrens J H and Dieter U (1974) Computer methods for sampling from gamma, beta, Poisson and binomial distributions Computing 12 223–46
Best D J (1978) Letter to the Editor Appl. Statist. 27 181
Dagpunar J (1988) Principles of Random Variate Generation Oxford University Press
Hastings N A J and Peacock J B (1975) Statistical Distributions Butterworths
g05 Chapter Introduction.
NAG Toolbox Overview.
NAG Web Site.
|
|