|
NAG[g05ecc] NAG[nag_ref_vec_poisson] - Set up reference vector for generating pseudo-random integers, Poisson distribution
|
|
Calling Sequence
g05ecc(t, r, 'fail'=fail)
nag_ref_vec_poisson(. . .)
Parameters
|
t - float;
|
|
|
On entry: the mean, , of the distribution.
|
|
Constraint: . .
|
|
|
r - assignable;
|
|
|
Note: On exit the variable r will have a value of type float.
|
|
On exit: reference vector for which memory will be allocated internally. If no memory is allocated to r (e.g. when an input error is detected) then r will be NULL on return, otherwise the user should use the NAG macro NAG_FREE to free the storage allocated by r when it is no longer of use.
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_ref_vec_poisson (g05ecc) sets up the reference vector r for a Poisson distribution with mean .
|
|
Description
|
|
This sets up a reference vector for use in g05eyc (nag_return_discrete). Together these functions produce random numbers from the Poisson distribution defined by:
The reference array is found using a recurrence relation if is less than 50 and by Stirling's formula otherwise.
|
|
Error Indicators and Warnings
|
|
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_REAL_ARG_LT"
On entry, t must not be less than 0.0: .
|
|
|
Examples
|
|
>
|
t := 2.7:
NAG:-g05cbc(0):
NAG:-g05ecc(t, r):
x := Vector(5):
for i from 1 to 5 do
x[i] := NAG:-g05eyc(r):
end do:
|
|
|
Download Help Document
Was this information helpful?