Skip to contents

Extracts coefficients from an object of class "cv.corila".

Usage

# S3 method for class 'cv.corila'
coef(object, s = "lambda.min", ...)

Arguments

object

object of class "cv.corila"

s

character "lambda.min" or numeric value

...

(for compatibility with stats::coef)

Value

Returns an \((1 + p)\)-dimensional vector of the estimated coefficients. The first entry is the estimated intercept, and the other \(p\) entries are the estimated slopes.

Details

This function calls .combine_slopes() to combine positive and negative coefficients and .backscale() to bring coefficients back to the original scale.

References

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

See also

Fit models with cv.corila() and make predictions with predict().

Examples

# \donttest{
data <- simulate_data()
model <- cv.corila(x = data$x_train,
                   y = data$y_train,
                   group = data$group,
                   primary = data$primary)
beta_hat <- coef(object = model)
y_hat <- predict(object = model, newx = data$x_test)
# }

# example for automatic mutation testing (with the R package autotest)
data <- simulate_data()
model <- cv.corila(x = data$x_train,
                   y = data$y_train,
                   group = as.double(data$group),
                   primary = data$primary,
                   alpha_init = 0.0,
                   foldid = rep(1:10, length.out = nrow(data$x_train)))