eecop | R Documentation |
Implements the copula regression estimators of Nagler and Vatter (2020). A model for marginal distributions and copula between response and covariates is estimated. Predictions for quantiles or expectiles can then be derived from solving a weighted estimating equations.
eecop(
y,
x,
copula_method = "vine",
margin_method = "kde",
weights = numeric(),
...
)
y |
vector with numeric response values. |
x |
vector, matrix, or data.frame with covariate values (rows are observations). |
copula_method |
method for estimating the copula(s); one of |
margin_method |
method for estimating marginal distributions; one of
|
weights |
optional; a vector of weights for each observation. |
... |
further arguments passed to |
Both y
and x
may contain discrete variables, which must be
passed as ordered()
or factor()
variables.
An object of class eecop
. Use predict.eecop()
to predict
quantiles or expectiles. For other estimating equations, the weights
w(x) = c_{YX}(Y, x)/ c_Y(Y)
can be computed from object$w(x)
.
Nagler, T. and Vatter, T. (2020). Solving estimating equations with copulas. arXiv:1801.10576
predict.eecop()
# model with continuous variables
x <- matrix(rnorm(200), 100, 2)
y <- rowSums(x) + rnorm(100)
fit <- eecop(y, x)
predict(fit, x, t = c(0.5, 0.9), type = "quantile")
predict(fit, x, t = c(0.5, 0.9), type = "expectile")
# model with discrete covariates
x <- as.data.frame(matrix(rbinom(200, 5, 0.3), 100, 2))
y <- rowSums(x) + rnorm(100)
for (k in 1:2) {
x[, k] <- ordered(x[, k], levels = 0:5)
}
fit <- eecop(y, x)
predict(fit, x, t = c(0.5, 0.9), type = "quantile")
predict(fit, x, t = c(0.5, 0.9), type = "expectile")
# multivariate responses
x1 <- rnorm(100, mean = 2)
x2 <- rnorm(100, sd = 2)
y1 <- x1 + abs(x2) * rnorm(100)
y2 <- -x1 + abs(x2) * rnorm(100)
y <- cbind(y1, y2)
x <- cbind(x1, x2)
fit <- eecop(y, x)
predict(fit, x[1:3, ], type = "mean")
predict(fit, x[1:3, ], type = "variance")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.