cv.mcen: Cross validation for mcen function

View source: R/mcen.r

cv.mcenR Documentation

Cross validation for mcen function

Description

Cross validation for mcen function

Usage

cv.mcen(x, y, family = "mgaussian", ky = seq(2, 4), gamma_y = seq(0.1,
  5.1, 0.5), nfolds = 10, folds = NULL, cluster_y = NULL, delta=NULL, n.cores = 1,
  ...)

Arguments

x

Matrix set of predictors.

y

Matrix set of responses.

family

The exponential family the response corresponds to.

ky

A vector with the number of possible clusters for y.

gamma_y

Set of tuning parameter for clustering penalty in response categories.

nfolds

Number of folds used in the cross-validation.

folds

A vector of length n, where this identifies what fold of the kfold cross validation each observation belongs to.

cluster_y

a priori definition of clusters. If clusters are provided they will remain fixed and are not estimated. Objective function is then convex.

delta

Tuning parameter for the L1 penalty

n.cores

Number of cores used for parallel processing.

...

The variables passed to mcen

Value

Returns a cv.mcen object.

models

A list of mcen objects.

cv

Cross validation results.

ky

The same value as the input ky.

gamma_y

The same value as the input gamma_y.

Author(s)

Ben Sherwood <ben.sherwood@ku.edu>, Brad Price <brad.price@mail.wvu.edu>

References

Price, B.S. and Sherwood, B. (2018). A Cluster Elastic Net for Multivariate Regression. arXiv preprint arXiv:1707.03530. http://arxiv-export-lb.library.cornell.edu/abs/1707.03530.

Examples


x <- matrix(rnorm(400),ncol=4)
beta <- beta <- matrix(c(1,1,0,0,0,0,-1,-1,0,0,-1,-1,1,1,0,0),ncol=4)
y <- x%*%beta + rnorm(400) 
cv_fit <- cv.mcen(x,y,ky=2)


mcen documentation built on April 1, 2023, 12:11 a.m.

Related to cv.mcen in mcen...