PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_rand_copula_frank (g05rj)
Purpose
nag_rand_copula_frank (g05rj) generates pseudorandom uniform variates with joint distribution of a Frank Archimedean copula.
Syntax
Description
Generates
pseudorandom uniform
-variates whose joint distribution is the Frank Archimedean copula
, given by
with the special case:
- , the Fréchet–Hoeffding upper bound.
The generation method uses mixture of powers.
One of the initialization functions
nag_rand_init_repeat (g05kf) (for a repeatable sequence if computed sequentially) or
nag_rand_init_nonrepeat (g05kg) (for a non-repeatable sequence) must be called prior to the first call to
nag_rand_copula_frank (g05rj).
References
Marshall A W and Olkin I (1988) Families of multivariate distributions Journal of the American Statistical Association 83 403
Nelsen R B (2006) An Introduction to Copulas (2nd Edition) Springer Series in Statistics
Parameters
Compulsory Input Parameters
- 1:
– int64int32nag_int scalar
-
, the number of pseudorandom uniform variates to generate.
Constraint:
.
- 2:
– int64int32nag_int scalar
-
, the number of dimensions.
Constraint:
.
- 3:
– double scalar
-
, the copula parameter.
Constraint:
.
- 4:
– int64int32nag_int scalar
-
Determines the storage order of variates; the
th variate is stored in if , and if , for and .
Constraint:
or .
- 5:
– int64int32nag_int array
-
Note: the actual argument supplied
must be the array
state supplied to the initialization routines
nag_rand_init_repeat (g05kf) or
nag_rand_init_nonrepeat (g05kg).
Contains information on the selected base generator and its current state.
Optional Input Parameters
None.
Output Parameters
- 1:
– int64int32nag_int array
-
Contains updated information on the state of the generator.
- 2:
– double array
-
The pseudorandom uniform variates with joint distribution described by , with holding the th value for the th dimension if and the th value for the th dimension of .
- 3:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
-
-
On entry, corrupt
state argument.
-
-
Constraint: .
-
-
Constraint: .
-
-
Constraint: .
-
-
On entry, invalid
sorder.
Constraint:
or
.
-
-
On entry, ldx is too small: .
-
-
On entry, sdx is too small: .
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
Not applicable.
Further Comments
In practice, the need for numerical stability restricts the range of
such that:
- the function requires ;
- if , the function returns pseudorandom uniform variates with joint distribution;
where
is the
machine precision returned by
nag_machine_precision (x02aj).
Example
This example generates thirteen four-dimensional variates for copula .
Open in the MATLAB editor:
g05rj_example
function g05rj_example
fprintf('g05rj example results\n\n');
seed = [int64(1762543)];
genid = int64(1);
subid = int64(1);
[state, ifail] = g05kf( ...
genid, subid, seed);
n = int64(13);
m = int64(4);
sorder = int64(1);
theta = 4;
[state, x, ifail] = g05rj( ...
n, m, theta, sorder, state);
disp('Variates from a Frank copula');
disp(x);
g05rj example results
Variates from a Frank copula
0.5679 0.1977 0.8682 0.2664
0.0965 0.3532 0.9773 0.3102
0.5526 0.2562 0.6341 0.6267
0.8036 0.4747 0.7310 0.5515
0.2043 0.9797 0.3628 0.4968
0.4777 0.8146 0.3922 0.4005
0.4162 0.5002 0.5074 0.2008
0.3703 0.0971 0.0527 0.0278
0.4354 0.4880 0.4096 0.4259
0.2693 0.1169 0.0639 0.1555
0.0127 0.3080 0.2352 0.4659
0.0730 0.3239 0.2020 0.0568
0.2369 0.0817 0.3118 0.4370
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015