aic.islasso {islasso} | R Documentation |
This function performs a minimization of the AIC/BIC criterion for selecting the tuning parameter in “islasso
”.
aic.islasso(object, method = c("aic", "bic"), interval, y, X, intercept = FALSE, family = gaussian(), alpha = 1, offset, weights, unpenalized, control = is.control())
object |
a fitted model object of class "islasso". |
method |
the criterion to optimize, AIC or BIC. |
interval |
the lower and upper limits of λ wherein the AIC/BIC criterion should be optimized. Can be missing, if |
y |
if |
X |
if |
intercept |
if |
family |
if |
alpha |
The elasticnet mixing parameter, with 0≤α≤ 1. The penalty is defined as (1-α)/2||β||_2^2+α||β||_1.
|
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 |
Minimization of the Akaike Information Criterion (AIC) or Bayesian Information Criterion (BIC) is 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 AIC/BIC are computed as trace of the hat matrix at convergence.
the optimal lambda value is returned
Gianluca Sottile
Maintainer: Gianluca Sottile <gianluca.sottile@unipa.it>
islasso.fit
, coef.islasso
, summary.islasso
, residuals.islasso
, AIC.islasso
, logLik.islasso
, fitted.islasso
, predict.islasso
and deviance.islasso
methods.
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 ~ 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") ## End(Not run)