R/select.glmnetcr.R

Defines functions select.glmnetcr

Documented in select.glmnetcr

select.glmnetcr <-
function(fit, which="BIC") {
	x <- fit$x
	method <- fit$method
	predict.fit<-predict.glmnetcr(fit,newx=x,method=method)
	if (c("BIC", "AIC")[charmatch(which, c("BIC","AIC"))] == "BIC") {which.min(predict.fit$BIC)}
	else if (c("BIC", "AIC")[charmatch(which, c("BIC","AIC"))] == "AIC") {which.min(predict.fit$AIC)}
}

Try the glmnetcr package in your browser

Any scripts or data that you put into this service are public.

glmnetcr documentation built on July 8, 2020, 6:21 p.m.