[Rd] prcomp need Conj(t(s$vt)) (PR#2924)

Paul Gilbert pgilbert at bank-banque-canada.ca
Wed May 7 10:54:50 MEST 2003


>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



More information about the R-devel mailing list