Bookmark and Share

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

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

Re: st: Guidance on matrix inversion for OLS in mata

From   Austin Nichols <>
Subject   Re: st: Guidance on matrix inversion for OLS in mata
Date   Tue, 27 Apr 2010 11:23:59 -0400

Thomas Jacobs <>:
Zero is not a problem, but you should expunge the missings first;
however you seem to be trying to rewrite -regress- as you go, which is
far from a good idea. Why *not* export your vectors to Stata and run
-regress- and let Stata handle the sample selection and matrix
inversion for you?

Maybe if you give us a simple example with real numbers, the problem
will be clearer and you can get better guidance...

On Tue, Apr 27, 2010 at 12:45 AM, Thomas Jacobs <> wrote:
> Hi,
> I am trying to perform a lengthy series of simulations to examine some
> event study methodologies.  I have moved to mata for the bulk of the
> work but find that for those cases where I wish to use a market model
> approach requiring an OLS regression to establish abnormal returns I
> am unable to generate an inverse for x'x in seeking to solve for beta
> hat.  I am typically working with vectors that have 1. missing values,
> 2. zero values, and 3. very small values close to zero (within a
> couple of decimal places such as -.01 or .005).  I have tried mata's
> cholinv, invsym, pinv, luinv, and qrinv (I realize that some of these
> are probably inappropriate for my problem but I am no expert) and
> generally get an inverse matrix of missing values or bizarre results
> like a single populated row.
> I would prefer not to go back and forth between stata and mata to use
> the stata regress function unless that is the only way to accomplish
> this effort.
> Can anyone offer general guidance on how to proceed here?  Thanks.
> Tom

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index