rrr.fit | R Documentation |
Given a response matrix and a covariate matrix, this function fits reduced rank regression for a specified rank. It reduces to singular value decomposition if the covariate matrix is the identity matrix.
rrr.fit(Y, X, nrank = 1, weight = NULL, coefSVD = FALSE)
Y |
a matrix of response (n by q) |
X |
a matrix of covariate (n by p) |
nrank |
an integer specifying the desired rank |
weight |
a square matrix of weight (q by q); The default is the identity matrix |
coefSVD |
logical indicating the need for SVD for the coeffient matrix in the output; used in ssvd estimation |
S3 rrr
object, a list consisting of
coef |
coefficient of rrr |
coef.ls |
coefficient of least square |
fitted |
fitted value of rrr |
fitted.ls |
fitted value of least square |
A |
right singular matrix |
Ad |
a vector of sigular values |
rank |
rank of the fitted rrr |
Y <- matrix(rnorm(400), 100, 4) X <- matrix(rnorm(800), 100, 8) rfit <- rrr.fit(Y, X, nrank = 2) coef(rfit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.