powered by
Cross validation for mcen function
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, ...)
Returns a cv.mcen object.
A list of mcen objects.
Cross validation results.
The same value as the input ky.
The same value as the input gamma_y.
Matrix set of predictors.
Matrix set of responses.
The exponential family the response corresponds to.
A vector with the number of possible clusters for y.
Set of tuning parameter for clustering penalty in response categories.
Number of folds used in the cross-validation.
A vector of length n, where this identifies what fold of the kfold cross validation each observation belongs to.
a priori definition of clusters. If clusters are provided they will remain fixed and are not estimated. Objective function is then convex.
Tuning parameter for the L1 penalty
Number of cores used for parallel processing.
The variables passed to mcen
Ben Sherwood <ben.sherwood@ku.edu>, Brad Price <brad.price@mail.wvu.edu>
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.
# \donttest{ 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) # }
Run the code above in your browser using DataLab