Hi,
I'm trying to do PCA on a n by p wide matrix (n < p), and I'd like to
get more principal components than there are rows. However, svd() only
returns a V matrix of with n columns (instead of p) unless the argument
nv=p is set (prcomp calls svd without setting it). Moreover, the
eigenvalues returned are always min(n, p) instead of p, even if nv is set:
> x <- matrix(rnorm(15), 3, 5)
> dim(svd(x)$v)
[1] 5 3
> length(svd(x)$d)
[1] 3
> dim(svd(x, nv=5)$v)
[1] 5 5
> length(svd(x, nv=5)$d)
[1] 3
>
Is there a way of getting more PCs and eigenvalues than rows? Is the
eigen-decomposition of the covariance matrix really that numerically
bad? (i.e., eigen(cov(x)) )
Thanks,
Gad
--
Gad Abraham
Dept. CSSE and NICTA
The University of Melbourne
Parkville 3010, Victoria, Australia
email: [EMAIL PROTECTED]
web: http://www.csse.unimelb.edu.au/~gabraham
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.