cv.grpregOverlap: Cross-validation for choosing regularization parameter lambda

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Performs k-fold cross validation for penalized regression models with overlapping grouped covariates over a grid of values for the regularization parameter lambda.

Usage

1
cv.grpregOverlap(X, y, group, ..., nfolds = 10, seed, trace = FALSE)

Arguments

X

The design matrix, without an intercept, as in grpregOverlap.

y

The response vector (or matrix), as in grpregOverlap.

group

A list of vectors containing group information, as in grpregOverlap.

...

Additional arguments to grpregOverlap.

nfolds

The number of cross-validation folds. Default is 10.

seed

Set the seed of the random number generator to obtain reproducible results.

trace

If set to TRUE, print out the progress of the cross-validation. Default is FALSE.

Details

This function is built upon cv.grpreg. The class can directly call plot function implemented for class cv.grpreg.

Value

An object with S3 class "cv.grpregOverlap", which inherits from class "cv.grpreg". The following variables are contained in the class (adopted from cv.grpreg).

cve

The error for each value of lambda, averaged across the cross-validation folds.

cvse

The estimated standard error associated with each value of for cve.

lambda

The sequence of regularization parameter values along which the cross-validation error was calculated.

fit

The fitted grpreg object for the whole data.

min

The index of lambda corresponding to lambda.min.

lambda.min

The value of lambda with the minimum cross-validation error.

null.dev

The deviance for the intercept-only model.

pe

If family="binomial", the cross-validation prediction error for each value of lambda.

Author(s)

Yaohui Zeng and Patrick Breheny

Maintainer: Yaohui Zeng <yaohui-zeng@uiowa.edu>

References

See Also

grpregOverlap, predict.grpregOverlap, summary, and cv.grpreg.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## linear regression, a simulation demo.
set.seed(123)
group <- list(gr1 = c(1, 2, 3),
              gr2 = c(1, 4),
              gr3 = c(2, 4, 5),
              gr4 = c(3, 5),
              gr5 = c(6))
beta.latent.T <- c(5, 5, 5, 0, 0, 0, 0, 0, 5, 5, 0) # true latent coefficients.
# beta.T <- c(5, 5, 10, 0, 5, 0), true variables: 1, 2, 3, 5; true groups: 1, 4.
X <- matrix(rnorm(n = 6*100), ncol = 6)
X.latent <- expandX(X, group)
y <- X.latent %*% beta.latent.T + rnorm(100)

cvfit <- cv.grpregOverlap(X, y, group, penalty = 'grMCP')
summary(cvfit)
plot(cvfit)
par(mfrow=c(2,2))
plot(cvfit, type="all")

Example output

Loading required package: Matrix
Loading required package: grpreg
---------------------------------------------------------------
Note: Overlapping-group selection via penalized regression: 
      'p.latent' is the number of latent variables!
---------------------------------------------------------------
grMCP-penalized linear regression with n=100, p=6 (p.latent=11)
At minimum cross-validation error (lambda=0.3766):
---------------------------------------------------------------
  Nonzero        coefficients: 4
  Nonzero latent coefficients: 5
  Nonzero groups: 2
  Cross-validation error of 1.19
  Maximum R-squared: 0.99
  Maximum signal-to-noise ratio: 109.72
  Scale estimate (sigma) at lambda.min: 1.089

grpregOverlap documentation built on May 2, 2019, 4:47 a.m.