Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: Matrix inversion "bug"


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: Matrix inversion "bug"
Date   Tue, 10 Jun 2003 19:28:31 +0100

David E Moore
> 
> Given Mark's description, this does indeed sound like a 
> "bug" or at least an
> annoying feature.  The problem, of course, is that Stata 
> doesn't "know" that the
> matrix in question is (supposed to be) symmetric.  I'm not 
> sure it's a great
> idea to use a procedure that forces symmetry, however, 
> because one might be
> tempted to use the procedure in situations that don't 
> guarantee (in principle)
> that a matrix is symmetric.  This is not Mark's situation, 
> but I can imagine one
> in which subtle programming issues obscure the problem and 
> an incorrect use of
> something like syminv2 could lead to difficulties.  And 
> wouldn't we also need a
> cholesky2 command?
> 
> Instead, I'd suggest that Stata develop an internally 
> created and maintained
> property for matrices that indicates whether or not it is 
> symmetric.  Perhaps
> this is already being done for diagonal matrices.  This 
> property would "know"
> that the result of particular matrix expressions should 
> create a symmetric
> matrix and enforce this by whatever internal operations are 
> necessary.  For
> example, Stata should know that if S is symmetric, then 
> X*S*X' is also
> symmetric.  If S had a property that indicated its 
> symmetric nature, then Stata
> could perform the appropriate calculations/manipulations to 
> ensure that the
> result of this expression is also symmetric, and assign it 
> the symmetric
> property as well.
> 
> Admittedly, this would require re-tooling Stata.  But it 
> would result in a
> change that was transparent to programmers and users 
> without having to add yet
> another special purpose command or two.

There is an -issym()- function in Stata 8. 

Nick 
n.j.cox@durham.ac.uk 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index