aic.islasso {islasso} | R Documentation |
Optimization for the selection of the tuning parameter
Description
This function performs a minimization of the AIC/BIC criterion for selecting the tuning parameter in “islasso
”.
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)
Arguments
object |
a fitted model object of class "islasso". |
method |
the criterion to optimize, AIC, BIC, AICc, GCV, GIC. |
interval |
the lower and upper limits of |
g |
a value belonging to the interval [0, 1]. Classical BIC is returned by letting g = 0 (default value), whereas extended BIC corresponds to the case g = 0.5. |
y |
if |
X |
if |
intercept |
if |
family |
if |
alpha |
The elasticnet mixing parameter, with
|
offset |
this can be used to specify an a priori known component to be included in the linear predictor during fitting. This should be NULL or a numeric vector of length equal to the number of cases. |
weights |
observation weights. Default is 1 for each observation. |
unpenalized |
a vector used to specify the unpenalized estimators; unpenalized has to be a vector of logicals. |
control |
a list of parameters for controlling the fitting process (see |
trace |
Should the iterative procedure be printed? TRUE is the default value. |
Details
Minimization of the Akaike Information Criterion (AIC), or Bayesian Information Criterion (BIC) or several other criteria are sometimes employed to select the tuning parameter as an alternative to the cross validation. The model degrees of freedom (not necessarly integers as in the plain lasso) used in all methods are computed as trace of the hat matrix at convergence.
Value
the optimal lambda value is returned
Author(s)
Maintainer: Gianluca Sottile <gianluca.sottile@unipa.it>
See Also
islasso.fit
, summary.islasso
, residuals.islasso
, logLik.islasso
, predict.islasso
and deviance.islasso
methods.
Examples
set.seed(1)
n <- 100
p <- 100
p1 <- 20 #number of nonzero coefficients
coef.veri <- sort(round(c(seq(.5, 3, l=p1/2), seq(-1, -2, l=p1/2)), 2))
sigma <- 1
coef <- c(coef.veri, rep(0, p-p1))
X <- matrix(rnorm(n*p), n, p)
mu <- drop(X%*%coef)
y <- mu + rnorm(n, 0, sigma)
o <- islasso(y ~ ., data = data.frame(y = y, X))
## 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(.1, 30), method = "BIC")
#overwrites the evaluation interval for lambda using eBIC criterion
lambda_ebic <- aic.islasso(o, interval = c(.1, 30), method = "BIC", g = .5)
## End(Not run)