NAG Library Routine Document
G05RGF
Note: before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.
1 Purpose
G05RGF generates pseudorandom uniform bivariates with joint distribution of a Plackett copula.
2 Specification
INTEGER
N, SORDER, STATE(*), LDX, SDX, IFAIL
REAL (KIND=nag_wp)
THETA, X(LDX,SDX)
3 Description
Generates pseudorandom uniform bivariates
whose joint distribution is the Plackett copula
with parameter
, given by
with the special cases:
- , the Fréchet–Hoeffding lower bound;
- , the product copula;
- , the Fréchet–Hoeffding upper bound.
The generation method uses conditional sampling.
One of the initialization routines
G05KFF (for a repeatable sequence if computed sequentially) or
G05KGF (for a non-repeatable sequence) must be called prior to the first call to G05RGF.
4 References
Nelsen R B (2006) An Introduction to Copulas (2nd Edition) Springer Series in Statistics
5 Parameters
- 1: N – INTEGERInput
On entry: , the number of bivariates to generate.
Constraint:
.
- 2: THETA – REAL (KIND=nag_wp)Input
On entry: , the copula parameter.
Constraint:
.
- 3: SORDER – INTEGERInput
On entry: determines the storage order of variates; the
th variate is stored in if , and if , for and .
Constraint:
or .
- 4: STATE() – INTEGER arrayCommunication Array
-
Note: the actual argument supplied must be the array
STATE supplied to the initialization routines
G05KFF or
G05KGF.
On entry: contains information on the selected base generator and its current state.
On exit: contains updated information on the state of the generator.
- 5: X(LDX,SDX) – REAL (KIND=nag_wp) arrayOutput
On exit: the bivariate uniforms with joint distribution described by , with holding the th value for the th dimension if and the th value for the th dimension of .
- 6: LDX – INTEGERInput
On entry: the first dimension of the array
X as declared in the (sub)program from which G05RGF is called.
Constraints:
- if , ;
- if , .
- 7: SDX – INTEGERInput
On entry: the second dimension of the array
X as declared in the (sub)program from which G05RGF is called.
Constraints:
- if , ;
- if , .
- 8: IFAIL – INTEGERInput/Output
On entry:
IFAIL must be set to
,
. If you are unfamiliar with this parameter you should refer to
Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
.
When the value is used it is essential to test the value of IFAIL on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6 Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
Errors or warnings detected by the routine:
On entry,
STATE vector was not initialized or has been corrupted.
-
On entry,
-
On entry, .
-
On entry, and .
-
On entry, and ,
or and .
-
On entry, and ,
or and .
7 Accuracy
Not applicable.
In practice, the need for numerical stability restricts the range of
such that:
- if , the routine returns pseudorandom uniform variates with joint distribution;
- if , the routine returns pseudorandom uniform variates with joint distribution;
- if , the routine returns pseudorandom uniform variates with joint distribution;
where
is the safe-range parameter, the value of which is returned by
X02AMF; and
is the
machine precision returned by
X02AJF.
9 Example
This example generates thirteen variates for copula .
9.1 Program Text
Program Text (g05rgfe.f90)
9.2 Program Data
Program Data (g05rgfe.d)
9.3 Program Results
Program Results (g05rgfe.r)