htrafo {copula} | R Documentation |
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 |
|
copula |
an Archimedean copula specified as
|
include.K |
logical indicating whether the last component, involving the
Kendall distribution function |
n.MC |
parameter |
inverse |
logical indicating whether the inverse of the transformation is returned. |
method |
method to compute |
u.grid |
argument of |
... |
additional arguments passed to |
Details
Given a d
-dimensional random vector
\bm{U}
following an Archimedean copula C
with
generator \psi
, Hering and Hofert (2014) showed that
\bm{U}^\prime\sim\mathrm{U}[0,1]^d
, where
U_{j}^\prime=\left(\frac{\sum_{k=1}^{j}\psi^{-1}(U_{k})}{
\sum_{k=1}^{j+1}\psi^{-1}(U_{k})}\right)^{j},\ j\in\{1,\dots,d-1\},\
U_{d}^\prime=K(C(\bm{U})).
htrafo
applies this transformation row-wise to
u
and thus returns either an n\times d
- or an
n\times (d-1)
-matrix, depending on whether the last
component U^\prime_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\times d
- or n\times (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