Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

hd.eigen

Eigenvalues in high dimensional principal component analysis


Description

Eigenvalues in high dimensional (n<<p) principal component analysis.

Usage

hd.eigen(x, center = TRUE, scale = FALSE, k = NULL, vectors = FALSE)

Arguments

x

A numerical n \times p matrix with data where the rows are the observations and the columns are the variables.

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.

Details

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.

Value

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 p \times n or p \times k eigenvectors.

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris <mtsagris@yahoo.gr>.

See Also

Examples

x <- matrnorm( 40, 100)
a <- hd.eigen(x, FALSE, FALSE)
b <- prcomp(x, center = FALSE, scale = FALSE)
a
b$sdev^2
x <- NULL

Rfast

A Collection of Efficient and Extremely Fast R Functions

v2.0.1
GPL (>= 2.0)
Authors
Manos Papadakis, Michail Tsagris, Marios Dimitriadis, Stefanos Fafalios, Ioannis Tsamardinos, Matteo Fasiolo, Giorgos Borboudakis, John Burkardt, Changliang Zou, Kleanthi Lakiotaki and Christina Chatzipantsiou.
Initial release
2020-09-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.