View source: R/estimate_risk.R
estimate_risk | R Documentation |
This function uses the degrees of freedom to calculate various information
criteria. This function uses the "unknown variance" version of the likelihood.
Only implemented for Gaussian regression. The constant is ignored (as in
stats::extractAIC()
).
estimate_risk(object, x, type = c("AIC", "BIC", "GCV"), approx_df = FALSE)
object |
fitted object from a call to |
x |
Matrix. The matrix of predictors used to estimate
the |
type |
one or more of AIC, BIC, or GCV. |
approx_df |
the |
a data.frame
with as many rows as object$lambda
. It contains
columns lambda
, df
, and the requested risk types.
Liang, X., Cohen, A., Sólon Heinsfeld, A., Pestilli, F., and
McDonald, D.J. 2024.
sparsegl: An R
Package for Estimating Sparse Group Lasso.
Journal of Statistical Software, Vol. 110(6): 1–23.
\Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v110.i06")}.
Vaiter S, Deledalle C, Peyré G, Fadili J, Dossal C. (2012). The Degrees of Freedom of the Group Lasso for a General Design. https://arxiv.org/abs/1212.6478.
sparsegl()
method.
n <- 100
p <- 20
X <- matrix(rnorm(n * p), nrow = n)
eps <- rnorm(n)
beta_star <- c(rep(5, 5), c(5, -5, 2, 0, 0), rep(-5, 5), rep(0, (p - 15)))
y <- X %*% beta_star + eps
groups <- rep(1:(p / 5), each = 5)
fit1 <- sparsegl(X, y, group = groups)
estimate_risk(fit1, type = "AIC", approx_df = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.