Description Usage Arguments Details Value Author(s) References See Also Examples
Does kfold crossvalidation for gglasso, produces a plot, and returns a
value for lambda
. This function is modified based on the cv
function from the glmnet
package.
1 2  cv.gglasso(x, y, group, lambda = NULL, pred.loss = c("misclass", "loss",
"L1", "L2"), nfolds = 5, foldid, delta, ...)

x 
matrix of predictors, of dimension n*p; each row is an observation vector. 
y 
response variable. This argument should be quantitative for regression (least squares), and a twolevel factor for classification (logistic model, huberized SVM, squared SVM). 
group 
a vector of consecutive integers describing the grouping of the coefficients (see example below). 
lambda 
optional usersupplied lambda sequence; default is

pred.loss 
loss to use for crossvalidation error. Valid options are:
Default is 
nfolds 
number of folds  default is 5. Although 
foldid 
an optional vector of values between 1 and 
delta 
parameter delta only used in huberized SVM for
computing loglikelihood on validation set, only available with

... 
other arguments that can be passed to gglasso. 
The function runs gglasso
nfolds
+1 times; the first to
get the lambda
sequence, and then the remainder to compute the fit
with each of the folds omitted. The average error and standard deviation
over the folds are computed.
an object of class cv.gglasso
is returned, which is a
list with the ingredients of the crossvalidation fit.
lambda 
the
values of 
cvm 
the mean
crossvalidated error  a vector of length 
cvsd 
estimate of standard error of 
cvupper 
upper
curve = 
cvlower 
lower curve = 
name 
a text string indicating type of measure (for plotting purposes). 
gglasso.fit 
a fitted 
lambda.min 
The optimal value of 
lambda.1se 
The largest
value of 
Yi Yang and Hui Zou
Maintainer: Yi Yang <[email protected]>
Yang, Y. and Zou, H. (2015), “A Fast Unified Algorithm for
Computing GroupLasso Penalized Learning Problems,” Statistics and
Computing. 25(6), 11291141.
BugReport:
https://github.com/emeryyi/gglasso
gglasso
, plot.cv.gglasso
,
predict.cv.gglasso
, and coef.cv.gglasso
methods.
1 2 3 4 5 6 7 8 9 10 11 12 13  # load gglasso library
library(gglasso)
# load data set
data(bardet)
# define group index
group < rep(1:20,each=5)
# 5fold cross validation using group lasso
# penalized logisitic regression
cv < cv.gglasso(x=bardet$x, y=bardet$y, group=group, loss="ls",
pred.loss="L2", lambda.factor=0.05, nfolds=5)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.