Usage
# S3 method for class 'multiridge'
predict(object, newx, ...)Arguments
- object
object of type
"multiridge"- newx
\(n_0 \times p\) predictor matrix (training data) to obtain fitted values, \(n_1 \times p\) predictor matrix (testing data) to obtain predicted values
- ...
(for compatibility with stats::predict)
Value
Returns an \(n_0\)-dimensional vector of fitted values or an \(n_1\)-dimensional vector of predicted values.
References
Mark A. van de Wiel, Mirrelijn M. van Nee and Armin Rauschenberger (2021). "Fast cross-validation for multi-penalty high-dimensional ridge regression" Journal of Computational and Graphical Statistics 30(4):835-847. doi:10.1080/10618600.2021.1904962 .
See also
Fit models with multiridge()
and extract coefficients with coef().
Examples
# \donttest{
data <- simulate_data(prob_primary = 1.0)
model <- multiridge(x = data$x_train, y = data$y_train, group = data$group)
beta_hat <- coef(model)
y_hat <- predict(object = model, newx = data$x_test)
# }