Learn R Programming

rrpack (version 0.1-14)

cv.rrr: Reduced-rank regression with rank selected by cross validation

Description

Reduced-rank regression with rank selected by cross validation

Usage

cv.rrr(
  Y,
  X,
  nfold = 10,
  maxrank = min(dim(Y), dim(X)),
  norder = NULL,
  coefSVD = FALSE
)

Value

a list containing rr estimates from cross validation

Arguments

Y

response matrix

X

covariate matrix

nfold

number of folds

maxrank

maximum rank allowed

norder

for constructing the folds

coefSVD

If TRUE, svd of the coefficient is retuned

References

Chen, K., Dong, H. and Chan, K.-S. (2013) Reduced rank regression via adaptive nuclear norm penalization. Biometrika, 100, 901--920.

Examples

Run this code
library(rrpack)
p <- 50; q <- 50; n <- 100; nrank <- 3
mydata <- rrr.sim1(n, p, q, nrank, s2n = 1, sigma = NULL,
                   rho_X = 0.5, rho_E = 0.3)
rfit_cv <- with(mydata, cv.rrr(Y, X, nfold = 10, maxrank = 10))
summary(rfit_cv)
coef(rfit_cv)

Run the code above in your browser using DataLab