Eigenvalues and eigenvectors in high dimensional principal component analysis | R Documentation |
Eigenvalues in high dimensional (n<<p) principal component analysis.
hd.eigen(x, center = TRUE, scale = FALSE, k = NULL, vectors = FALSE, large = FALSE)
x |
A numerical |
center |
Do you want your data centered? TRUE or FALSE. |
scale |
Do you want each of your variables scaled, i.e. to have unit variance? TRUE or FALSE. |
k |
If you want a specific number of eigenvalues and eigenvectors set it here, otherwise all eigenvalues (and eigenvectors if requested) will be returned. |
vectors |
Do you want the eigenvectors be returned? By dafault this is FALSE. |
large |
If you have large matrices, with thousands of rows and or many tens or hundreds of columns set this equal to TRUE in
order to use Rfast's |
When n<<p
, at most the first n eigenvalues are non zero. Hence, there is no need to calculate the other
p-n zero eigenvalues. When center is TRUE, the eigenvalues of the covariance matrix are calculated.
When both the center and scale is TRUE the eigenvalues of the correlation matrix are calculated. One or more
eigenvectors (towards the end) will be 0. In general the signs might be the opposite than R's, but this makes
no difference. We use the Crossprod
instead of the relevant built-in function. The higher the
dimensions of the matrix are the faster this function becomes.
A list including:
values |
A vector with the n (or first k) eigenvalues. The divisor in the crossproduc matrix is n-1 and not n. |
vectors |
A matrix of |
Michail Tsagris.
R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr>.
rmdp
x <- matrnorm( 40, 100)
a <- hd.eigen(x, FALSE, FALSE)
b <- prcomp(x, center = FALSE, scale = FALSE)
a
b$sdev^2
x <- NULL
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.