Learn R Programming

islasso (version 1.6.0)

aic.islasso: Optimization for Lambda Selection

Description

Minimizes information criteria to select the optimal tuning parameter lambda for islasso models. Supports AIC, BIC, AICc, GCV, and GIC.

Usage

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
)

Value

Optimal lambda value as numeric.

Arguments

object

Fitted model of class "islasso".

method

Criterion to minimize. Options are "AIC", "BIC", "AICc", "GCV", "GIC".

interval

Numeric vector (length 2) giving lower and upper bounds for lambda optimization. Optional if object includes prior cross-validation.

g

Numeric in [0,1]. Governs BIC generalization: g = 0 is classic BIC, g = 0.5 is extended BIC.

y

Response vector. Required only if object is missing.

X

Design matrix. Required only if object is missing.

intercept

Logical. Whether to include intercept in X. Used if object is missing.

family

Error distribution. Accepted: gaussian, binomial, poisson. Uses canonical link.

alpha

Elastic-net mixing parameter, 0 <= alpha <= 1. Lasso: alpha = 1; Ridge: alpha = 0.

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 is.control.

trace

Logical. If TRUE, prints progress of optimization. Default is TRUE.

Author

Gianluca Sottile gianluca.sottile@unipa.it

Details

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).

See Also

islasso, islasso.fit, summary.islasso, logLik.islasso, predict.islasso

Examples

Run this code
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())

if (FALSE) {
# 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)
}

Run the code above in your browser using DataLab