X: a data matrix. The number of columns and the corresponding names have to coincide with the specifications of the copula model hac.
hac: an object of the class hac.
n: number of observations.
margins: specifies the margins. The data matrix X 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 parametric way, e.g. "norm". See estimate.copula for a detailed explanation.
na.rm: boolean. If na.rm = TRUE, missing values, NA, contained in X are removed.
eval: boolean. If eval = FALSE, a non-evaluated function is returned. Note, that attr"gradient" of the returned function corresponds to the values density.
...: arguments to be passed to na.omit.
Returns
rHAC retruns a n×d matrix, where d refers to the dimension of the HAC. dHAC and pHAC return vectors. The computation of the density might be time consuming for high-dimensions, since the density is defined as d-th derivative of the HAC with respect to its arguments u1,…,ud.
Details
Sampling schemes of hierarchical and densities of simple Archimedean copula are based on functions of the copula package.
References
Hofert, M. 2011, Efficiently Sampling Nested Archimedean Copulas, Computational Statistics & Data Analysis 55, 57-70.
Joe, H. 1997, Multivariate Models and Dependence Concepts, Chapman & Hall.
McNeil, A. J. 2008, Sampling Nested Archimedean Copulas, Journal of Statistical Computation and Simulation 78, 567-581.
Nelsen, R. B. 2006, An Introduction to Copulas, Spinger, 2nd Edition.
Okhrin, O. and Ristig, A. 2014, Hierarchical Archimedean Copulae: The HAC Package", Journal of Statistical Software, 58(4), 1-20, tools:::Rd_expr_doi("10.18637/jss.v058.i04") .
Savu, C. and Trede, M. 2010, Hierarchies of Archimedean copulas, Quantitative Finance 10, 295-304.
See Also
estimate.copula, to.logLik
Examples
# AC example# define the underlying modelmodel = hac(type =4, tree = list("X1","X2",2))# sample from modelsample = rHAC(100, model)# returns the pdf/cdf at each vector of the sampled.values = dHAC(sample, model)p.values = pHAC(sample, model)# HAC example# the underlying modely = c("X1","X2","X3")theta = c(1.5,3)model = hac.full(type =1, y, theta)# define sample from copula modelsample = rHAC(100, model)# returns the pdf/cdf at each point of the sampled.values = dHAC(sample, model)p.values = pHAC(sample, model)# construct a hac-modeltree = list(list("X1","X5",3), list("X2","X3","X4",4),2)model = hac(type =1, tree = tree)# sample from copula modelsample = rHAC(1000, model)# check the accurancy of the estimation procedureresult1 = estimate.copula(sample)result2 = estimate.copula(sample, epsilon =0.2)