# tune.cosso: Tuning procedure for cosso In cosso: Fit Regularized Nonparametric Regression Models Using COSSO Penalty

 tune.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

`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)
``````

cosso documentation built on March 31, 2023, 8:25 p.m.