coef.cv.SplitReg {SplitReg} | R Documentation |
Extract coefficients from a cv.SplitReg object.
Description
Extract coefficients from a cv.SplitReg object.
Usage
## S3 method for class 'cv.SplitReg'
coef(object, index = object$index_opt, ...)
Arguments
object |
Fitted cv.SplitReg object. |
index |
Indices indicating values of lambda_S at which to extract coefficients. Defaults to the optimal value. |
... |
Additional arguments for compatibility. |
Value
A vector of coefficients
See Also
Examples
library(MASS)
set.seed(1)
beta <- c(rep(5, 5), rep(0, 45))
Sigma <- matrix(0.5, 50, 50)
diag(Sigma) <- 1
x <- mvrnorm(50, mu = rep(0, 50), Sigma = Sigma)
y <- x %*% beta + rnorm(50)
fit <- cv.SplitReg(x, y, num_models=2)
split.coefs <- coef(fit)
[Package SplitReg version 1.0.2 Index]