select function

Select an value of lambda along a grpreg path

Select an value of lambda along a grpreg path

Selects a point along the regularization path of a fitted grpreg object according to the AIC, BIC, or GCV criteria.

select(obj, ...) ## S3 method for class 'grpreg' select( obj, criterion = c("BIC", "AIC", "GCV", "AICc", "EBIC"), df.method = c("default", "active"), smooth = FALSE, ... )

Arguments

  • obj: A fitted grpreg object.
  • ...: For S3 method compatibility.
  • criterion: The criterion by which to select the regularization parameter. One of "AIC", "BIC", "GCV", "AICc", or "EBIC"; default is "BIC".
  • df.method: How should effective model parameters be calculated? One of: "active", which counts the number of nonzero coefficients; or "default", which uses the calculated df returned by grpreg. Default is "default".
  • smooth: Applies a smoother to the information criteria before selecting the optimal value.

Returns

A list containing:

  • lambda: The selected value of the regularization parameter, lambda.
  • beta: The vector of coefficients at the chosen value of lambda.
  • df: The effective number of model parameters at the chosen value of lambda.
  • IC: A vector of the calculated model selection criteria for each point on the regularization path.

Details

The criteria are defined as follows, where LL is the deviance (i.e, -2 times the log-likelihood), dfdf is the degrees of freedom, and nn is the sample size:

AIC=L+2\nuAIC=L+2df AIC = L + 2\nuAIC = L + 2*df BIC=L+log(n)\nuBIC=L+log(n)df BIC = L + \log(n)\nuBIC = L +log(n)*df GCV=L(1ν/n)2GCV=L/((1df/n)2) GCV = \frac{L}{(1-\nu/n)^2}GCV= L/((1-df/n)^2) AICc=AIC+2ν(ν+1)nν1AICc=AIC+2df(df+1)/(ndf1) AICc = AIC + 2\frac{\nu(\nu+1)}{n-\nu-1}AICc = AIC +2*df*(df+1)/(n-df-1) EBIC=BIC+2log(pν)EBIC=BIC+2log(pchoosedf) EBIC = BIC + 2 \log{p \choose \nu}EBIC = BIC +2*log(p choose df)

Examples

data(Birthwt) X <- Birthwt$X y <- Birthwt$bwt group <- Birthwt$group fit <- grpreg(X, y, group, penalty="grLasso") select(fit) select(fit,crit="AIC",df="active") plot(fit) abline(v=select(fit)$lambda) par(mfrow=c(1,3)) l <- fit$lambda xlim <- rev(range(l)) plot(l, select(fit)$IC, xlim=xlim, pch=19, type="o", ylab="BIC") plot(l, select(fit,"AIC")$IC, xlim=xlim, pch=19, type="o",ylab="AIC") plot(l, select(fit,"GCV")$IC, xlim=xlim, pch=19, type="o",ylab="GCV")

See Also

grpreg()