The distribution has PDF (probability density function)
where
is a vector of dimension
, such that
for all
and
.
One of the initialization functions
g05kfc (for a repeatable sequence if computed sequentially) or
g05kgc (for a non-repeatable sequence) must be called prior to the first call to
g05sec.
-
1:
– Nag_OrderType
Input
-
On entry: the
order argument specifies the two-dimensional storage scheme being used, i.e., row-major ordering or column-major ordering. C language defined storage is specified by
. See
Section 3.1.3 in the Introduction to the NAG Library CL Interface for a more detailed explanation of the use of this argument.
Constraint:
or .
-
2:
– Integer
Input
-
On entry: , the number of pseudorandom numbers to be generated.
Constraint:
.
-
3:
– Integer
Input
-
On entry: , the number of dimensions of the distribution.
Constraint:
.
-
4:
– const double
Input
-
On entry: the parameter vector for the distribution.
Constraint:
, for .
-
5:
– Integer
Communication Array
Note: the dimension,
, of this array is dictated by the requirements of associated functions that must have been previously called. This array MUST be the same array passed as argument
state in the previous call to
nag_rand_init_repeatable (g05kfc) or
nag_rand_init_nonrepeatable (g05kgc).
On entry: contains information on the selected base generator and its current state.
On exit: contains updated information on the state of the generator.
-
6:
– double
Output
-
Note: the dimension,
dim, of the array
x
must be at least
-
when ;
-
when .
where
appears in this document, it refers to the array element
- when ;
- when .
On exit: the pseudorandom numbers from the specified Dirichlet distribution, with holding the th dimension for the th variate.
-
7:
– Integer
Input
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
x.
Constraints:
- if ,
;
- if , .
-
8:
– NagError *
Input/Output
-
The NAG error argument (see
Section 7 in the Introduction to the NAG Library CL Interface).
Not applicable.
Background information to multithreading can be found in the
Multithreading documentation.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
None.
This example prints a set of five pseudorandom numbers from a Dirichlet distribution with parameters
and
, generated by a single call to
g05sec, after initialization by
g05kfc.
None.