Last data update: 2014.03.03

R: Estimation of Hierarchical Archimedean Copulae
estimate.copulaR Documentation

Estimation of Hierarchical Archimedean Copulae

Description

The function estimates the parameters and determines the structure of Hierarchical Archimedean Copulae.

Usage

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

Arguments

X

a n \times d matrix. If there are no colnames provided, the names X1, X2, ... will be given.

type

defines the copula family, see phi for an overview of implemented families.

method

the estimation method. Select between quasi Maximum Likelihood 1, full Maximum Likelihood 2, recursive Maximum Likelihood 3 and penalized Maximum Likelihood 4.

hac

a hac object, which determines the structure and provides initial values. An object must be provided, if method = 2 referring to the full Maximum Likelihood procedure.

epsilon

scalar ≥q 0. The variables of consecutive nodes are aggregated, if the difference of the dependency parameters is smaller than epsilon. For a detailed explanation see also aggregate.hac.

agg.method

if ε > 0, the new dependency parameter can be determined by "mean", "min" or "max" of the two parameters, see aggregate.hac.

margins

specifies the margins. The data matrix is assumed to contain the values of the marginal distributions by default, i.e. margins = NULL. If raw data are used, the margins can be determined nonparametrically, "edf", or in a parametric way, e.g. "norm". Following the latter approach, the parameters of the distributions are estimated by Maximum Likelihood. Building on these estimates the values of the univariate margins are computed. If the argument is defined as scalar, all margins are computed according to this specification. Otherwise, different margins can be defined, e.g. c("norm", "t", "edf") for a 3-dimensional sample. Almost all continuous functions of Distributions are available. Inappropriate usage of this argument might lead to misspecified margins, e.g. application of "exp" even though the sample contains negative values.

na.rm

boolean. If na.rm = TRUE, missing values, NA, contained in X are removed.

max.min

boolean. If max.min = TRUE and an element of X is ≥q 1 or ≤q 0, it is set to 1-10^{-8} and 10^{-8} respectively.

...

further arguments passed to or from other methods, e.g. na.omit.

Value

A hac object is returned.

References

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.

Gorecki, J., Hofert, M. and Holena, M. 2014, On the Consistency of an Estimator for Hierarchical Archimedean Copulas, In Talaysova, J., Stoklasa, J., Talaysek, T. (Eds.) 32nd International Conference on Mathematical Methods in Economics, Olomouc: Palacky University, 239-244.

Joe, H. 2005, Asymptotic Efficiency of the Two-Stage Estimation Method for Copula-Based Models, Journal of Multivariate Analysis 94(2), 401-419.

Okhrin, O., Okhrin, Y. and Schmid, W. 2013, On the Structure and Estimation of Hierarchical Archimedean Copulas, Journal of Econometrics 173, 189-204.

Okhrin, O. and Ristig, A. 2014, Hierarchical Archimedean Copulae: The HAC Package", Journal of Statistical Software, 58(4), 1-20, http://www.jstatsoft.org/v58/i04/.

Okhrin, O., Ristig, A., Sheen J. and Trueck, S. 2015, Conditional Systemic Risk with Penalized Copula, SFB 649 Discussion Paper 2015-038, Sonderforschungsbereich 649, Humboldt University, Germany.

Examples

# define the copula model
tree = list(list("X1", "X5", 3), list("X2", "X3", "X4", 4), 2)
model = hac(type = 1, tree = tree)

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

# in the following case the true model is binary approximated
est.obj = estimate.copula(x, type = 1, method = 1, epsilon = 0)
plot(est.obj)

# consider also the aggregation of the variables
est.obj = estimate.copula(x, type = 1, method = 1, epsilon = 0.2)
plot(est.obj)

# full ML estimation to yield more precise parameter
est.obj.full = estimate.copula(x, type = 1, method = 2, hac = est.obj)

# recursive ML estimation leads to almost identical results
est.obj.r = estimate.copula(x, type = 1, method = 3)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(HAC)
Loading required package: copula
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/HAC/estimate.copula.Rd_%03d_medium.png", width=480, height=480)
> ### Name: estimate.copula
> ### Title: Estimation of Hierarchical Archimedean Copulae
> ### Aliases: estimate.copula
> 
> ### ** Examples
> 
> # define the copula model
> tree = list(list("X1", "X5", 3), list("X2", "X3", "X4", 4), 2)
> model = hac(type = 1, tree = tree)
> 
> # sample from copula model
> x = rHAC(1000, model)
[1] "X1 <-> 1"
[1] "X5 <-> 2"
[1] "X2 <-> 3"
[1] "X3 <-> 4"
[1] "X4 <-> 5"
Warning message:
In hac2nacopula(hac) : NAs introduced by coercion
> 
> # in the following case the true model is binary approximated
> est.obj = estimate.copula(x, type = 1, method = 1, epsilon = 0)
> plot(est.obj)
> 
> # consider also the aggregation of the variables
> est.obj = estimate.copula(x, type = 1, method = 1, epsilon = 0.2)
> plot(est.obj)
> 
> # full ML estimation to yield more precise parameter
> est.obj.full = estimate.copula(x, type = 1, method = 2, hac = est.obj)
> 
> # recursive ML estimation leads to almost identical results
> est.obj.r = estimate.copula(x, type = 1, method = 3)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>