Bookmark and Share

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]

Re: st: Slow -rolling- regressions on panel data


From   Richard Herron <[email protected]>
To   [email protected]
Subject   Re: st: Slow -rolling- regressions on panel data
Date   Tue, 27 Sep 2011 06:59:37 -0400

Thanks, all, for the input!

I was able to get a serviceable solution using -correlate- to find beta.

The next think I need to learn in Stats is writing my own .ado files
and using Mata (when you loop over the existing functions, I think
there can be too much overhead).

On Tue, Sep 27, 2011 at 03:59, Nick Cox <[email protected]> wrote:
> Actually, I would guess that Austin's suggestion will run faster than
> this, but we're just trading speculation.
>
> Nick
>
> On Tue, Sep 27, 2011 at 7:32 AM, Partho Sarkar
> <[email protected]> wrote:
>> Richard
>>
>> If all you really want is the autocorrelation coefficient, of course
>> you don't really need -regress-, which does much more than just
>> generate the regression coefficients.  As an alternative to Austin's
>> suggestion (and apriori I would expect this to be faster)
>> you could also get the AC's via matrix computations in Mata, successively
>> passing the  y-vector (and the lagged y-vector?) for each firm to Mata
>> within a loop, computing the sums, inner products etc., and passing
>> the result back to Stata.
>>
>> Of course, Nick's point still holds: given your data size, this is
>> likely to be time-consuming in any case.
>>
>> As a last thought, you are presumably interested in doing this for
>> some "real" data- I think you might have an ill-conditioned matrix
>> with your artificial example, which would partly account for the slow
>> regressions.
>>
>> Hope this helps
>>
>> Partho
>>
>> ___________________________
>> From  Richard Herron <[email protected]>
>> To  [email protected]
>> Subject  st: Slow -rolling- regressions on panel data
>> Date  Mon, 26 Sep 2011 10:37:35 -0400
>> ________________________________
>>
>> I am using -rolling- for rolling regressions on panel data, but it is
>> exceedingly slow. I found a Statalist thread
>> (http://www.stata.com/statalist/archive/2009-09/msg01239.html) with a
>> more manual solution, but it is equally slow (both are too slow to run
>> to completion in a reasonable amount of time).
>>
>> Is -regress- the bottleneck? I only want the AR(1) coefficient; is
>> there a different approach I should take? Are rolling
>> regressions/calculations best done in different software?
>>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/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/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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