matop {HDBRR} | R Documentation |
matop
Description
Compute the SVD or QR decomposition of the matrix X.
Usage
matop(y = NULL, X, method = c("svd", "qr"), bigmat = TRUE)
Arguments
y |
The data vector (numeric, n) NAs allowed. The default value is NULL, It is possible to compute the SVD or QR decomposition without y. |
X |
Design Matrix of dimension n x p. |
method |
Options for the posterior computation. Two methods, |
bigmat |
Use of the bigstatsr package. The default value for bigmat is |
Details
Use the bigstartsr package when p >> n
. Auxiliary in the HDBRR function.
Value
If the method used is svd then the list containing the following components:
y |
The data vector (numeric, |
X |
Design Matrix of dimension |
D |
A vector containing the singular values of |
L |
A matrix whose columns contain the left singular vectors of |
R |
A matrix whose columns contain the right singular vectors of |
ev |
A vector containing the square of |
Ly |
The cross-product between the matrix |
n |
Number of rows of |
p |
Number of columns of |
If the method used is qr then the list containing the following components:
y |
The data vector (numeric, |
X |
Design Matrix of dimension |
R |
An upper triangular matrix of dimension |
n |
Number of rows of |
p |
Number of columns of |
Author(s)
Sergio Perez-Elizalde, Blanca E. Monroy-Castillo, Paulino Perez-Rodriguez.
See Also
Examples
n <- 30
p <- 100
X <- matrix(rnorm(n*(p-1),1,1/p),nrow = n,ncol = p-1)
Beta <- sample(1:p,p-1,rep = FALSE)
Beta <- c(1,Beta)
y <- cbind(rep(1,n),X) %*% Beta+rnorm(n,0,1)
matop(y, X, bigmat = TRUE)