Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

htrafo

GOF Testing Transformation of Hering and Hofert


Description

The transformation described in Hering and Hofert (2014), for Archimedean copulas.

Usage

htrafo(u, copula, include.K = TRUE, n.MC = 0, inverse = FALSE,
       method = eval(formals(qK)$method), u.grid, ...)

Arguments

u

n x d-matrix with values in [0,1]. If inverse=FALSE (the default), u contains (pseudo-/copula-)observations from the copula copula based on which the transformation is carried out; consider applying the function pobs() first in order to obtain u. If inverse=TRUE, u contains U[0,1]^d distributed values which are transformed to copula-based (copula) ones.

copula

an Archimedean copula specified as "outer_nacopula" or "archmCopula".

include.K

logical indicating whether the last component, involving the Kendall distribution function K, is used in htrafo().

n.MC

parameter n.MC for K.

inverse

logical indicating whether the inverse of the transformation is returned.

method

method to compute qK().

u.grid

argument of qK() (for method="discrete").

...

additional arguments passed to qK() if inverse = TRUE.

Details

Given a d-dimensional random vector U following an Archimedean copula C with generator ψ, Hering and Hofert (2014) showed that U'~U[0,1]^d, where

U'_j = ((psi^{-1}(U_1) + ... + psi^{-1}(U_j)) / (psi^{-1}(U_1) + ... + psi^{-1}(U_{j+1})))^j, j in {1,..., d-1}, U'_d = K(C(U)).

htrafo applies this transformation row-wise to u and thus returns either an n x d- or an n x (d-1)-matrix, depending on whether the last component U'_d which involves the (possibly numerically challenging) Kendall distribution function K is used (include.K=TRUE) or not (include.K=FALSE).

Value

htrafo() returns an n x d- or n x (d-1)-matrix (depending on whether include.K is TRUE or FALSE) containing the transformed input u.

References

Hering, C. and Hofert, M. (2014). Goodness-of-fit tests for Archimedean copulas in high dimensions. Innovations in Quantitative Risk Management.

Examples

## Sample and build pseudo-observations (what we normally have available)
## of a Clayton copula
tau <- 0.5
theta <- iTau(claytonCopula(), tau = tau)
d <- 5
cc <- claytonCopula(theta, dim = d)
set.seed(271)
n <- 1000
U <- rCopula(n, copula = cc)
X <- qnorm(U) # X now follows a meta-Gumbel model with N(0,1) marginals
U <- pobs(X) # build pseudo-observations

## Graphically check if the data comes from a meta-Clayton model
## with the transformation of Hering and Hofert (2014):
U.H <- htrafo(U, copula = cc) # transform the data
splom2(U.H, cex = 0.2) # looks good

## The same for an 'outer_nacopula' object
cc. <- onacopulaL("Clayton", list(theta, 1:d))
U.H. <- htrafo(U, copula = cc.)
splom2(U.H., cex = 0.2) # looks good

## What about a meta-Gumbel model?
## The parameter is chosen such that Kendall's tau equals (the same) tau
gc <- gumbelCopula(iTau(gumbelCopula(), tau = tau), dim = d)

## Plot of the transformed data (Hering and Hofert (2014)) to see the
## deviations from uniformity
U.H.. <- htrafo(U, copula = gc)
splom2(U.H.., cex = 0.2) # deviations visible

copula

Multivariate Dependence with Copulas

v1.0-1
GPL (>= 3) | file LICENCE
Authors
Marius Hofert [aut] (<https://orcid.org/0000-0001-8009-4665>), Ivan Kojadinovic [aut] (<https://orcid.org/0000-0002-2903-1543>), Martin Maechler [aut, cre] (<https://orcid.org/0000-0002-8685-9910>), Jun Yan [aut] (<https://orcid.org/0000-0003-4401-7296>), Johanna G. Nešlehová [ctb] (evTestK(), <https://orcid.org/0000-0001-9634-4796>), Rebecca Morger [ctb] (fitCopula.ml(): code for free mixCopula weight parameters)
Initial release
2020-12-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.