Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

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

From |
"G. Anderson" <ga274@cam.ac.uk> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Problems with matrix multiplication and syminv |

Date |
14 Jun 2013 09:07:40 +0100 |

Hi, Sorry, yes it will be at least positive semi definite.

Thanks, Gareth On Jun 14 2013, Sergiy Radyakin wrote:

no, by construction it is positive semi-definite. On Thu, Jun 13, 2013 at 8:13 PM, G. Anderson <ga274@cam.ac.uk> wrote:Hi, I was using invsym on Stata- just used mata to check the rank. I thought by construction the outer product, X'X is positive definite?What I don't understand is why when X is of full rank I get rankdeficient X'X- this seems to be the source of the problem to me. Couldthere be some rounding error going on with the matrix multiplication orsomething else perhaps?Thanks, Gareth On Jun 14 2013, Sergiy Radyakin wrote: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 ofvariables, X Note that a lot of the values of X are zero-not sure ifthis is problematic)so matrix outerproduct=X'X matrix invouterproduct=syminv(outerproduct)The problem is when I calculate the syminv, I always get a row ofzeros. It seems when I change the data, the location of this row ofzeros 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 getthis result but suspect it has something to do with the fact that Iget 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/* * 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/

**References**:**st: Problems with matrix multiplication and syminv***From:*"G. Anderson" <ga274@cam.ac.uk>

**Re: st: Problems with matrix multiplication and syminv***From:*Sergiy Radyakin <serjradyakin@gmail.com>

**Re: st: Problems with matrix multiplication and syminv***From:*"G. Anderson" <ga274@cam.ac.uk>

**Re: st: Problems with matrix multiplication and syminv***From:*Sergiy Radyakin <serjradyakin@gmail.com>

- Prev by Date:
**st: shanken corrected standard errors** - Next by Date:
**st: margins, marginsplot and piecewise regression** - Previous by thread:
**Re: st: Problems with matrix multiplication and syminv** - Next by thread:
**st: shanken corrected standard errors** - Index(es):