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