predict.eecop | R Documentation |
Predicts quantiles, expectiles, mean vectors, or covariate matrices from an
eecop()
model by solving a weighted estimating equations as in Nagler and
Vatter (2020).
## S3 method for class 'eecop'
predict(object, x, type = "expectile", t = 0.5, trafo = function(y) y, ...)
object |
an |
x |
covariate values to predict on; must match the format used for
fitting the |
type |
either |
t |
a vector of quantile/expectile levels. |
trafo |
a function with signature |
... |
unused. |
For "quantile"
and "expectile"
: a matrix of predictions, each
column corresponding to one t
(in the order they were supplied to
predict()
. For "mean"
, a matrix containing the predicted mean vectors
in the rows. For "variance"
an 3-dimensional array containing the
predicted variance/covariance matrices.
Nagler, T. and Vatter, T. (2020). Solving estimating equations with copulas. arXiv:1801.10576
# univariate response
x <- matrix(rnorm(200), 100, 2)
y <- rowSums(x) + rnorm(100)
fit <- eecop(y, x)
predict(fit, x[1:3, ], t = c(0.5, 0.9), type = "quantile")
predict(fit, x[1:3, ], t = c(0.5, 0.9), type = "expectile")
# multivariate response
y <- cbind(y1 = y, y2 = y + rnorm(100))
fit <- eecop(y, x)
predict(fit, x[1:3, ], type = "mean")
predict(fit, x[1:3, ], type = "variance")
predict(fit, x[1:3, ], type = "quantile", trafo = function(y) y[, 1] + y[, 2])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.