GramPCA: Perform PCA using Gram matrix

Description Usage Arguments Value Author(s) See Also Examples

View source: R/GramPCA.R

Description

This function performs PCA using the eigenvectors of the Gram matrix G (G=X*X') when n < p, or standard PCA when n > p.

Usage

1
GramPCA(xx, npc)

Arguments

xx

The data matrix (n x p).

npc

The number of principal components to be returned.

Value

zz

Principal components (n x npc).

Author(s)

Bernd Taschler: bernd.taschler@dzne.de

See Also

pca

eigen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  ## standard Normal 10x50 matrix, 3 PC's
  GramPCA(xx = matrix(rnorm(500),10), npc = 3)
  
  ## 100x5 matrix (use standard PCA):
  GramPCA(xx = matrix(rnorm(500),100), npc = 3)
  
  ## Not run: 
  ## large 100x10,000 matrix:
  GramPCA(xx = matrix(rnorm(1e6),100), npc = 3)
  
## End(Not run)

btaschler/mcap documentation built on May 26, 2019, 1:31 a.m.