Learn R Programming

HAC (version 0.1-7)

estimate.copula: Estimation of the structure of HAC

Description

This function estimates the parameter and determines the structure of Hierarchical Archimedean Copulae.

Usage

estimate.copula(X, type = HAC_GUMBEL, method = TAU, epsilon = 0,
agg.method = "mean", margins = NULL, na.rm = FALSE, max.min = TRUE)

Arguments

X
a matrix, which contains the data. The columns should be labeled. The default names X1, ..., Xdim[X]2 are given otherwise.
type
defines the model. It can be selected between HAC_GUMBEL, AC_GUMBEL, HAC_CLAYTON, AC_CLAYTON and GAUSS.
method
the estimation method. Either ``Kendall's $\tau$'' denoted by TAU or ``Quasi Maximum Likelihood'' denoted by ML.
epsilon
scalar $\geq 0$. The variables of consecutive nodes are aggregated, if the difference of their dependency parameters is smaller than epsilon. For a detailed explanation see also aggregate.hac
agg.method
if $\epsilon > 0$, the new dependency parameter can be determined by "mean", "min" or "max" of the of the two previous; see also aggregate.hac.
margins
scalar or vector specifying the marginal distributions. They can be determined nonparametrically denoted by "edf" or in a parametric way , e.g. "norm". According to the latter approach the parameter of the distributions are estim
na.rm
boolean. If na.rm = TRUE and a row of X contains NA, the row is removed and not used for the computation. Corresponding warnings are shown.
max.min
boolean. If max.min = TRUE and an element of X is $\geq 1$ or $\leq 0$, it is set to $1-10^{-6}$ and $10^{-6}$ respectively.

Value

  • A hac object is returned. In the case of type=GAUSS a matrix is returned.

Details

Because negative dependencies cannot be estimated basing on the implemented HAC-types, the correlations are set to $0$, if variables of X are negatively correlated and Kendall's $\tau$ is chosen as estimation method.

References

Okhrin, O., Okhrin, Y. and Schmid, W., Determining the structure and estimation of hierarchical Archimedean copulas, Journal of Econometrics, under revision. Joe, H. 2005, Asymptotic efficiency of the two-stage estimation method for copula-based models, Journal of Multivariate Analysis, Volume 94 Issue 2, 401-419. Genest, C., Ghoudi, K., and Rivest, L. P. 1995, A Semiparametric Estimation Procedure of Dependence Parameters in Multivariate Families of Distributions, Biometrika 82, 543-552.

Examples

Run this code
M = matrix(c(2, 0, 0, 0, 3, 4, 0, 0, ~X1 + X5, ~X2, ~X3, ~X4),
ncol = 4, byrow = TRUE)
g.model = hac(HAC_GUMBEL, M)

# sample from copula g.model
x = rHAC(1000, g.model)

# in the following case the true model is binary approximated
est.obj = estimate.copula(x, HAC_GUMBEL, TAU, epsilon = 0)
plot(est.obj, index = TRUE)

# consider also the aggregation of the variables
est.obj = estimate.copula(x, HAC_GUMBEL, TAU, epsilon = 0.1)
plot(est.obj, index = TRUE)

# if margins != NULL
data = rmnorm(1000, varcov = matrix(c(5, 2, 0, 2, 20, 0, 0, 0, 40), 
ncol = 3))

result1 = estimate.copula(data, method = ML, margins = "norm")
result2 = estimate.copula(data, method = ML, margins = c("norm",
"norm", "norm"))

Run the code above in your browser using DataLab