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

estim-misc

Various Estimators for (Nested) Archimedean Copulas


Description

Various Estimators for (Nested) Archimedean Copulas, namely,

ebeta

Method-of-moments-like estimator based on (a multivariate version of) Blomqvist'sbeta.

edmle

Maximum likelihood estimator based on the diagonal of a (nested) Archimedean copula.

etau

Method-of-moments-like estimators based on (bivariate) Kendall's tau.

Usage

ebeta(u, cop, interval = initOpt(cop@copula@name), ...)
edmle(u, cop, interval = initOpt(cop@copula@name), warn=TRUE, ...)
 etau(u, cop, method = c("tau.mean", "theta.mean"), warn=TRUE, ...)

Arguments

u

n x d-matrix of (pseudo-)observations (each value in [0,1]) from the copula, where n denotes the sample size and d the dimension.

cop

outer_nacopula to be estimated (currently only Archimedean copulas are provided).

interval

bivariate vector denoting the interval where optimization takes place. The default is computed as described in Hofert et al. (2013).

method

a character string specifying the method (only for etau), which has to be one (or a unique abbreviation) of

"tau.mean"

method-of-moments-like estimator based on the average of pairwise sample versions of Kendall’s tau;

"theta.mean"

average of the method-of-moments-like Kendall's tau estimators.

warn

logical indicating if warnings are printed:

edmle()

for the family of "Gumbel" if the diagonal maximum-likelihood estimator is smaller than 1.

etau()

for the family of "AMH" if tau is outside [0, 1/3] and in general if at least one of the computed pairwise sample versions of Kendall's tau is negative.

...

additional arguments passed to corKendall (for etau, but see ‘Details’), to optimize (for edmle), or to safeUroot (for ebeta).

Details

For ebeta, the parameter is estimated with a method-of-moments-like procedure such that the population version of the multivariate Blomqvist's beta matches its sample version.

Note that the copula diagonal is a distribution function and the maximum of all components of a random vector following the copula is distributed according to this distribution function. For edmle, the parameter is estimated via maximum-likelihood estimation based on the diagonal.

For etau, corKendall(u, ...) is used and if there are no NAs in u, by default (if no additional arguments are provided), corKendall() calls the O(n log(n)) fast cor.fk() from package pcaPP instead of the O(n^2) cor(*, method="kendall"). Conversely, when u has NAs, by default, corKendall(u, ...) will use cor(u, method="kendall", use = "pairwise") such that etau(u, *) will work.
Furthermore, method="tau.mean" means that the average of sample versions of Kendall's tau are computed first and then the parameter is determined such that the population version of Kendall's tau matches this average (if possible); the method="theta.mean" stands for first computing all pairwise Kendall's tau estimators and then returning the mean of these estimators.

For more details, see Hofert et al. (2013).

Note that these estimators should be used with care; see the performance results in Hofert et al. (2013). In particular, etau should be used with the (default) method "tau.mean" since "theta.mean" is both slower and more prone to errors.

Value

ebeta

the return value of safeUroot (that is, typically almost the same as the value of uniroot) giving the Blomqvist beta estimator.

edmle

list as returned by optimize, including the diagonal maximum likelihood estimator.

etau

method-of-moments-like estimator based on Kendall's tau for the chosen method.

References

Hofert, M., Mächler, M., and McNeil, A. J. (2013). Archimedean Copulas in High Dimensions: Estimators and Numerical Challenges Motivated by Financial Applications. Journal de la Société Française de Statistique 154(1), 25–63.

See Also

The more sophisticated estimators emle (Maximum Likelihood) and emde (Minimum Distance). enacopula (wrapper for different estimators).

Examples

tau <- 0.25
(theta <- copGumbel@iTau(tau)) # 4/3 = 1.333..
d <- 20
(cop <- onacopulaL("Gumbel", list(theta,1:d)))

set.seed(1)
n <- 200
U <- rnacopula(n, cop)

system.time(theta.hat.beta <- ebeta(U, cop=cop))
theta.hat.beta$root

system.time(theta.hat.dmle <- edmle(U, cop=cop))
theta.hat.dmle$minimum

system.time(theta.hat.etau <- etau(U, cop=cop, method="tau.mean"))
theta.hat.etau

system.time(theta.hat.etau. <- etau(U, cop=cop, method="theta.mean"))
theta.hat.etau.

## etau()  in the case of missing values (NA's)
## ------                 ---------------------
##' @title add Missing Values completely at random
##' @param x  matrix or vector
##' @param prob desired probability ("fraction") of missing values (\code{\link{NA}}s).
##' @return x[] with some (100*prob percent) entries replaced by \code{\link{NA}}s.
addNAs <- function(x, prob) {
    np <- length(x)
    x[sample.int(np, prob*np)] <- NA
    x
}

## UM[] := U[] with 5% missing values
set.seed(7); UM <- addNAs(U, p = 0.05)
mean(is.na(UM)) # 0.05
## This error if x has NA's was happening for  etau(UM, cop=cop)
## before copula version 0.999-17 (June 2017) :
try(eM <- etau(UM, cop=cop, use = "everything"))
        #  --> Error ... NA/NaN/Inf in foreign function call
## The new default:
eM0 <- etau(UM, cop=cop, use = "pairwise")
eM1 <- etau(UM, cop=cop, use = "complete")
##  use = "complete" is really equivalent to dropping all obs. with with missing values:
stopifnot(all.equal(eM1, etau(na.omit(UM), cop=cop), tol = 1e-15))
## but  use = "pairwise" ---> cor(*, use = "pairwise") is much better:
rbind(etau.U = theta.hat.etau, etau.UM.pairwise = eM0, etau.UM.complete = eM1)

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.