aic.islasso | R Documentation |
Minimizes information criteria to select the optimal tuning parameter lambda
for islasso
models.
Supports AIC, BIC, AICc, GCV, and GIC.
aic.islasso(
object,
method = c("AIC", "BIC", "AICc", "GCV", "GIC"),
interval,
g = 0,
y,
X,
intercept = FALSE,
family = gaussian(),
alpha = 1,
offset,
weights,
unpenalized,
control = is.control(),
trace = TRUE
)
object |
Fitted model of class |
method |
Criterion to minimize. Options are |
interval |
Numeric vector (length 2) giving lower and upper bounds for |
g |
Numeric in |
y |
Response vector. Required only if |
X |
Design matrix. Required only if |
intercept |
Logical. Whether to include intercept in |
family |
Error distribution. Accepted: |
alpha |
Elastic-net mixing parameter, |
offset |
Optional numeric vector. Adds known linear predictor component. |
weights |
Optional weights for observations. Defaults to 1. |
unpenalized |
Logical vector indicating variables to exclude from penalization. |
control |
List of control parameters. See |
trace |
Logical. If |
Instead of using cross-validation, this function selects the best lambda
by minimizing criteria like AIC or BIC.
Degrees of freedom are computed as the trace of the hat matrix (not necessarily an integer).
Optimal lambda
value as numeric.
Gianluca Sottile gianluca.sottile@unipa.it
islasso
, islasso.fit
, summary.islasso
, logLik.islasso
, predict.islasso
set.seed(1)
n <- 100; p <- 100
beta <- c(rep(2, 20), rep(0, p - 20))
sim1 <- simulXy(n = n, p = p, beta = beta, seed = 1, family = gaussian())
o <- islasso(y ~ ., data = sim1$data, family = gaussian())
## Not run:
# Use the evaluation interval of the fit
lambda_aic <- aic.islasso(o, method = "AIC")
# Overwrites the evaluation interval for lambda
lambda_bic <- aic.islasso(o, interval = c(0.1, 30), method = "BIC")
# Overwrites the evaluation interval for lambda using eBIC criterion
lambda_ebic <- aic.islasso(o, interval = c(0.1, 30), method = "BIC", g = 0.5)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.