Skip to contents

Makes prediction from an object of class "corila".

Usage

# S3 method for class 'corila'
predict(object, newx, index, s, ...)

Arguments

object

object of class "corila"

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

index

integer scalar specifying the index of the mixing hyperparameter(s)

s

numeric vector specifying the values of the regularisation hyperparameter

...

(for compatibility with stats::predict)

Value

Returns fitted or predicted values in an \(n_0 \times m\)-dimensional or \(n_1 \times m\)-dimensional matrix, respectively.

References

Armin Rauschenberger (2026). "Sparse modelling with grouped and correlated features allowing for privileged information". In preparation.

See also

Estimate parameters with corila(), or estimate parameters and tune hyperparameters with cv.corila().

Examples

# \donttest{
# simulation
n <- 100L
p <- 50L
group <- rep(x = seq_len(10L), each = 5L)
primary <- rep(x = TRUE, times = p)
x <- matrix(data = rnorm(n * p), nrow = n, ncol = p)
y <- rnorm(n = n)

# model fitting
hyper <- data.frame(wgt_local = 0.5, exp_local = 1.0,
                    wgt_global = 0.5, exp_global = 1.0)
object <- corila(x = x,
                 y = y,
                 group = group,
                 primary = primary,
                 family = "gaussian",
                 alpha_init = 0.0,
                 alpha_final = 1.0,
                 cor = "spearman",
                 foldid = NULL,
                 nfolds = 10L,
                 hyper = hyper,
                 lambda_init = NULL)

y_hat <- stats::predict(object, newx = x, index = 1L, s = 0.0)
# }