hac {HAC}R Documentation

Construction of hac objects

Description

hac objects are required as input argument for several functions, e.g. plot.hac and rHAC. They can be constructed by hac and hac.full. The latter function produces only fully nested Archimedean copulae, whereas hac can construct arbitrary dependence structures for a given family. Moreover, the functions hac2nacopula and nacopula2hac ensure the compatability with the copula package.

Usage

hac(type, tree)
hac.full(type, y, theta)
## S3 method for class 'hac'
print(x, digits = 2, ...)
hac2nacopula(x)
nacopula2hac(outer_nacopula)

Arguments

y

a vector containing the variables, which are denoted by a character, e.g. "X1".

theta

a vector containing the HAC parameters, which should be ordered from top to down. The length of theta must be equal to length(y) - 1.

tree

a list object of the general structure list(..., numeric(1)). The last argument of the list, numeric(1), denotes the dependency parameter. The arguments ... are either of the same structure or of the class character. The character objects denote variables and embedded lists refer to nested subcopulae.

type

all copula-types are admissible, see phi for an overview of implemented families.

x

a hac object.

outer_nacopula

an nacopula object. The variables of the outer_nacopula object 1, 2, ... are translated into the characters "X1", "X2", ....

digits

specifies the digits, see tree2str.

...

arguments to be passed to cat.

Value

A hac object is returned.

type

the specified copula type.

tree

the structure of the HAC.

References

Hofert, M. and Maechler, M. 2011, Nested Archimedean Copulas Meet R: The ⁠nacopula⁠ Package, Journal of Statistical Software, 39(9), 1-20, doi: 10.18637/jss.v039.i09.

Hofert, M., Kojadinovic, I., Maechler, M. and Yan, J. 2015, ⁠copula⁠: Multivariate Dependence with Copulas, R package version 0.999-14, https://CRAN.R-project.org/package=copula.

Kojadinovic, I., Yan, J. 2010, Modeling Multivariate Distributions with Continuous Margins Using the ⁠copula⁠ R Package, Journal of Statistical Software, 34(9), 1-20. doi: 10.18637/jss.v034.i09.

Okhrin, O. and Ristig, A. 2014, Hierarchical Archimedean Copulae: The ⁠HAC⁠ Package", Journal of Statistical Software, 58(4), 1-20, doi: 10.18637/jss.v058.i04.

Yan, J. 2007, Enjoy the Joy of Copulas: With a Package ⁠copula⁠, Journal of Statistical Software, 21(4), 1-21, doi: 10.18637/jss.v021.i04.

Examples

# it might be helpful to plot the hac objects
# Example 1: 4-dim AC
tree = list("X1", "X2", "X3", "X4", 2)
AC = hac(type = 1, tree = tree)

# Example 2: 4-dim HAC
y = c("X1", "X4", "X3", "X2")
theta = c(2, 3, 4)

HAC1 = hac.full(type = 1, y = y, theta = theta)
HAC2 = hac(type = 1, tree = list(list(list("X2", "X3", 4), 
"X4", 3), "X1", 2))
tree2str(HAC1) == tree2str(HAC2) # [1] TRUE

# Example 3: 9-dim HAC

HAC = hac(type = 1, tree = list("X6", "X5", list("X2", "X4", "X3", 4.4),
list("X1", "X7", 3.3), list("X8", "X9", 4), 2.3))
plot(HAC)

[Package HAC version 1.1-0 Index]