g05tj generates a vector of pseudorandom integers from the discrete Poisson distribution with mean .
Public Shared Sub g05tj ( _ mode As Integer, _ n As Integer, _ lambda As Double, _ r As Double(), _ g05state As G05..::..G05State, _ x As Integer(), _ <OutAttribute> ByRef ifail As Integer _ )
public: static void g05tj( int mode, int n, double lambda, array<double>^ r, G05..::..G05State^ g05state, array<int>^ x, [OutAttribute] int% ifail )
- Type: System..::..Int32On entry: a code for selecting the operation to be performed by the method.
Constraint: , , or .
- Set up reference vector only.
- Generate variates using reference vector set up in a prior call to g05tj.
- Set up reference vector and generate variates.
- Generate variates without using the reference vector.
- Type: System..::..Int32On entry: , the number of pseudorandom numbers to be generated.Constraint: .
- Type: System..::..DoubleOn entry: , the mean of the Poisson distribution.Constraint: .
- Type: array<System..::..Int32>()An array of size [n]On exit: the pseudorandom numbers from the specified Poisson distribution.
g05tj generates integers from a discrete Poisson distribution with mean , where the probability of is
The variates can be generated with or without using a search table and index. If a search table is used then it is stored with the index in a reference vector and subsequent calls to g05tj with the same parameter values can then use this reference vector to generate further variates. The reference array is found using a recurrence relation if is less than and by Stirling's formula otherwise.
One of the initialization methods (G05KFF not in this release) (for a repeatable sequence if computed sequentially) or (G05KGF not in this release) (for a non-repeatable sequence) must be called prior to the first call to g05tj.
Kendall M G and Stuart A (1969) The Advanced Theory of Statistics (Volume 1) (3rd Edition) Griffin
Knuth D E (1981) The Art of Computer Programming (Volume 2) (2nd Edition) Addison–Wesley
Errors or warnings detected by the method:
- On entry, , , or .
- On entry, .
- On entry, .
- On entry, the r vector was not initialized correctly, or has been corrupted.
- On entry, lr is too small when or .
On entry, state vector was not initialized or has been corrupted.