tune.cosso {cosso}R Documentation

Tuning procedure for cosso

Description

Compute K-fold cross-validated score and plot cross-validated score against a grid values of smooth parameter M.

Usage

 
tune.cosso(object,folds=5,plot.it=TRUE)   

Arguments

object

a cosso object.

folds

number of folds for corss-validation. Default is 5. It is not recommended to use folds less than 4.

plot.it

if TRUE, plot the cross-validated score against a sequence values of M.

Value

OptM

the optimal smoothing parameter for M.

M

used tuning grid points.

cvm

the mean cross-validated error/minus log-likelihood.

cvsd

estimate of standard error of cvm.

Author(s)

Hao Helen Zhang and Chen-Yen Lin

See Also

cosso, predict.cosso

Examples

 
## Binomial
set.seed(20130310)
x=cbind(rbinom(150,1,.7),matrix(runif(150*5,0,1),nc=5))
trueProb=1/(1+exp(-x[,1]-sin(2*pi*x[,2])-5*(x[,4]-0.4)^2))
y=rbinom(150,1,trueProb)

B.Obj=cosso(x,y,family="Bin",nbasis=30) 
tune.cosso(B.Obj,4,TRUE)

[Package cosso version 2.1-2 Index]