g05se generates a vector of pseudorandom numbers taken from a Dirichlet distribution.
Syntax
C# |
---|
public static void g05se( int n, int m, double[] a, G05..::..G05State g05state, double[,] x, out int ifail ) |
Visual Basic |
---|
Public Shared Sub g05se ( _ n As Integer, _ m As Integer, _ a As Double(), _ g05state As G05..::..G05State, _ x As Double(,), _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void g05se( int n, int m, array<double>^ a, G05..::..G05State^ g05state, array<double,2>^ x, [OutAttribute] int% ifail ) |
F# |
---|
static member g05se : n : int * m : int * a : float[] * g05state : G05..::..G05State * x : float[,] * ifail : int byref -> unit |
Parameters
- n
- Type: System..::..Int32On entry: , the number of pseudorandom numbers to be generated.Constraint: .
- m
- Type: System..::..Int32On entry: , the number of dimensions of the distribution.Constraint: .
- a
- Type: array<System..::..Double>[]()[][]An array of size [m]On entry: the parameter vector for the distribution.Constraint: , for .
- g05state
- Type: NagLibrary..::..G05..::..G05StateAn Object of type G05.G05State.
- x
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, _tdx]Note: dim1 must satisfy the constraint:On exit: the pseudorandom numbers from the specified Dirichlet distribution, with holding the th dimension for the th variate.
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
The distribution has PDF (probability density function)
where is a vector of dimension , such that for all and .
g05se generates a draw from a Dirichlet distribution by first drawing independent samples, , i.e., independent draws from a gamma distribution with parameters and one, and then setting .
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 g05se.
References
Dagpunar J (1988) Principles of Random Variate Generation Oxford University Press
Hastings N A J and Peacock J B (1975) Statistical Distributions Butterworth
Error Indicators and Warnings
Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface
(LDX) In these
cases, an error in another parameter has usually caused an incorrect value to be inferred.
- On entry, .
- On entry, .
- On entry, at least one .
On entry, state vector was not initialized or has been corrupted.
- On entry, .
Accuracy
Not applicable.
Parallelism and Performance
None.
Further Comments
None.