nag_rand_copula_clayton (g05rhc) (PDF version)
g05 Chapter Contents
g05 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_rand_copula_clayton (g05rhc)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_rand_copula_clayton (g05rhc) generates pseudorandom uniform variates with joint distribution of a Clayton/Cook–Johnson Archimedean copula.

2  Specification

#include <nag.h>
#include <nagg05.h>
void  nag_rand_copula_clayton (Nag_OrderType order, Integer state[], double theta, Integer n, Integer m, double x[], Integer pdx, Integer sdx, NagError *fail)

3  Description

Generates n pseudorandom uniform m-variates whose joint distribution is the Clayton/Cook–Johnson Archimedean copula Cθ, given by
Cθ = u1-θ + u2-θ + + um-θ - m + 1 -1/θ ,   θ 0, , uj 0,1 ,   j = 1 , m ;
with the special case:
The generation method uses mixture of powers.
One of the initialization functions nag_rand_init_repeatable (g05kfc) (for a repeatable sequence if computed sequentially) or nag_rand_init_nonrepeatable (g05kgc) (for a non-repeatable sequence) must be called prior to the first call to nag_rand_copula_clayton (g05rhc).

4  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

5  Arguments

1:     orderNag_OrderTypeInput
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 order=Nag_RowMajor. See Section in the Essential Introduction for a more detailed explanation of the use of this argument.
Constraint: order=Nag_RowMajor or Nag_ColMajor.
2:     state[dim]IntegerCommunication Array
Note: the dimension, dim, 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.
3:     thetadoubleInput
On entry: θ, the copula parameter.
Constraint: theta1.0×10-6.
4:     nIntegerInput
On entry: n, the number of pseudorandom uniform variates to generate.
Constraint: n0.
5:     mIntegerInput
On entry: m, the number of dimensions.
Constraint: m2.
6:     x[pdx×sdx]doubleOutput
Note: where Xi,j appears in this document, it refers to the array element
  • x[j-1×pdx+i-1] when order=Nag_ColMajor;
  • x[i-1×pdx+j-1] when order=Nag_RowMajor.
On exit: the pseudorandom uniform variates with joint distribution described by Cθ, with Xi,j holding the ith value for the jth dimension if order=Nag_ColMajor and the jth value for the ith dimension of order=Nag_RowMajor.
7:     pdxIntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array x.
  • if order=Nag_ColMajor, pdxn;
  • if order=Nag_RowMajor, pdxm.
8:     sdxIntegerInput
On entry: the secondary dimension of X.
  • if order=Nag_ColMajor, sdxm;
  • if order=Nag_RowMajor, sdxn.
9:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

Dynamic memory allocation failed.
On entry, argument value had an illegal value.
On entry, m=value.
Constraint: m>1.
On entry, n=value.
Constraint: n0.
On entry, pdx must be at least value: pdx=value.
On entry, sdx must be at least value: sdx=value.
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
On entry, corrupt state argument.
On entry, invalid theta: theta=value.
Constraint: theta1.0×10-6.

7  Accuracy

Not applicable.

8  Parallelism and Performance

nag_rand_copula_clayton (g05rhc) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
Please consult the Users' Note for your implementation for any additional implementation-specific information.

9  Further Comments

In practice, the need for numerical stability restricts the range of θ such that:

10  Example

This example generates thirteen four-dimensional variates for copula C1.3.

10.1  Program Text

Program Text (g05rhce.c)

10.2  Program Data


10.3  Program Results

Program Results (g05rhce.r)

nag_rand_copula_clayton (g05rhc) (PDF version)
g05 Chapter Contents
g05 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2014