pgilbert@bank-banque-canada.ca
2003-May-05 20:14 UTC
[Rd] prcomp need Conj(t(s$vt)) (PR#2924)
In prcomp s <- La.svd(x, nu = 0) s$v <- t(s$vt) the second above line should be s$v <- Conj(t(s$vt)) (to cover complex cases). Paul Gilbert
On Mon, 5 May 2003 pgilbert@bank-banque-canada.ca wrote:> In prcomp > > s <- La.svd(x, nu = 0) > s$v <- t(s$vt) > > the second above line should be > > s$v <- Conj(t(s$vt)) > > (to cover complex cases).They are not covered in the help page, AFAICS. They are certainly not covered in the references quoted. Are you not jumping to conclusions? There is a lot of R that does not handle complex cases, and does not say so. (lm, for one.) -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
>On Mon, 5 May 2003 pgilbert at bank-banque-canada.ca wrote:>> In prcomp >> >> s <- La.svd(x, nu = 0) >> s$v <- t(s$vt) >> >> the second above line should be >> >> s$v <- Conj(t(s$vt)) >> >> (to cover complex cases).On Mon, 5 May 2003 Prof. Brian Ripley wrote:>They are not covered in the help page, AFAICS.>They are certainly not covered in the references quoted.>Are you not jumping to conclusions? There is a lot of R that does not >handle complex cases, and does not say so. (lm, for one.)Sorry for the delay, I seem to be experiencing some mail problems. The prcomp documentation says "matrix" and does not say that the complex case is not handle but, as you say, there may be many instances of this in R. It says that prcomp uses La.svd, for which the documentation does mention the complex case. More importantly, prcomp() now fails in the complex case by return the wrong answer. I think it should either fail with an error message or return the correct answer. (And I think the only change required to return the correct answer is that mentioned above.) Paul Gilbert