Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Problems with matrix multiplication and syminv


From   Sergiy Radyakin <serjradyakin@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Problems with matrix multiplication and syminv
Date   Thu, 13 Jun 2013 20:05:41 -0400

Dear Gareth,
it might be full rank, but is it positive definite? See help for
invsym(M), as I assume you mean invsym() not syminv() as you typed.
In general you don't get a row of zeroes:

mata
:  X=1,2\3,4
: op=X'X
: iop=invsym(outerproduct)


Best, Sergiy Radyakin

On Thu, Jun 13, 2013 at 7:51 PM, G. Anderson <ga274@cam.ac.uk> wrote:
> Hi,
>
> I am having problems with matrix multiplication and inverting matrices using
> Stata.
>
> I want to compute the inverse of the outer product of a matrix of variables,
> X Note that a lot of the values of X are zero-not sure if this is
> problematic)
>
> so
>
> matrix outerproduct=X'X
> matrix invouterproduct=syminv(outerproduct)
>
> The problem is when I calculate the syminv, I always get a row of zeros. It
> seems when I change the data, the location of this row of zeros changes.
>
>
> A quick check of the rank of X using mata shows it is of full rank (47), but
> the rank of outerproduct is only 46- I'm not sure why i get this result but
> suspect it has something to do with the fact that I get a row of zeros.
>
> Any ideas?
>
>
> Thanks,
>
> Gareth
>
>
>
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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