From pgilbert@bank-banque-canada.ca  Fri Sep 29 14:37:47 2000
From: pgilbert@bank-banque-canada.ca (Paul Gilbert)
Date: Fri, 29 Sep 2000 09:37:47 -0400
Subject: [Rd] Re: [R] non-ideal behavior in princomp/ not a feature but a bug
References: <F169284AF6DDD111AA000001FAF836E8012308D8@LLNBBS22>
Message-ID: <39D49B2B.C054D6FA@bank-banque-canada.ca>

>2. However, not all matrices work, such as the first one I tried yesterday.
>Here is
>an example of a matrix which does not work.
>> x
>     [,1] [,2] [,3] [,4]
>[1,] -0.4 -1.6 -1.0 -1.8
>[2,] -2.2 -0.3  1.4  0.2
>> princomp(x)
>Error in princomp(x) : covariance matrix is not non-negative definite

This does not happen with this example in Solaris, but I have had similar
problems with eigen before and had to use something like eigen( (cv + t(cv))/2 )
to avoid it. It seems to me that if eigen is called with symmetric = TRUE, as is
done in princomp, then eigen should return an error message about a
non-symmetric matrix, rather than return a possibly spurious answer from which
negative eigenvalues are checked to test for a non symmetric matrix.

Paul Gilbert


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] Re: [R] non-ideal behavior in princomp/ not a feature but a bug
Paul Gilbert