From ryszard.czerminski at pharma.novartis.com  Thu Jan 15 15:31:25 2004
From: ryszard.czerminski at pharma.novartis.com (ryszard.czerminski@pharma.novartis.com)
Date: Thu Jan 15 15:29:41 2004
Subject: [Rd] prcomp scale error (PR#6433)
Message-ID: <20040115143125.DE0971047A@slim.kubism.ku.dk>

Full_Name: Ryszard Czerminski
Version: 1.8.1
OS: GNU/Linux
Submission from: (NULL) (205.181.102.120)


prcomp(..., scale = TRUE) does not work correctly:

$ uname -a
Linux 2.4.20-28.9bigmem #1 SMP Thu Dec 18 13:27:33 EST 2003 i686 i686 i386
GNU/Linux
$ gcc --version
gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

> a <- matrix(rnorm(6), nrow = 3)
> sum((scale(a %*% svd(cov(a))$u, scale = F)[,1] - (prcomp(a, scale =
F)$x)[,1])^2)
[1] 2.465190e-31
> sum((scale(a %*% svd(cov(a))$u, scale = T)[,1] - (prcomp(a, scale =
T)$x)[,1])^2)
[1] 0.5493767


[Rd] prcomp scale error (PR#6433)
ryszard.czerminski@pharma.novartis.com