Re: [R] Dimensions of svd V matrix

From: Gad Abraham <>
Date: Sat, 17 May 2008 11:00:16 +1000

Kenn Konstabel wrote:
> I'm not an expert at all, but isn't it that you really want svd(x)$u to
> be different (instead of V)?
> that would be easy to do:
> x <- matrix(rnorm(15), 3, 5)
> s1 <- svd(x)
> s2 <- svd(x, nv=ncol(x))
> x1 <- s1$u %*% diag(s1$d) %*% t(s1$v)
> x2 <- cbind(s2$u,1,1) %*% diag(c(s1$d,0,0)) %*% t(s2$v)
> all.equal(x,x1,x2)

Yep, you're absolutely correct. As someone's explained to me, the number of PCs cannot be larger than the rank of the matrix, therefore like you say the rest of the eigenvalues are practically zero anyway.


Gad Abraham
Dept. CSSE and NICTA
The University of Melbourne
Parkville 3010, Victoria, Australia

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sat 17 May 2008 - 01:08:39 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 17 May 2008 - 01:30:38 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive