Path: news.mathworks.com!newsfeed!bloom-beacon.mit.edu!cambridge1-snf1.gtei.net!news.gtei.net!bos-service1.ext.raytheon.com!cyclone.swbell.net!newsfeed1.easynews.com!easynews.com!easynews!pln-w!spln!dex!extra.newsguy.com!newsp.newsguy.com!derrico
From: John D'Errico <derrico@flare.net>
Newsgroups: comp.soft-sys.matlab
Subject: Re: vectorized rolling regression?
Date: Fri, 16 May 2003 13:09:35 -0400
Organization: Eastman Kodak Company
Lines: 37
Message-ID: <derrico-E50BC0.13093516052003@news.newsguy.com>
References: <eebdf1d.-1@WebX.raydaftYaTP> <derrico-78F3FA.09114716052003@news.newsguy.com> <eebdf1d.1@WebX.raydaftYaTP> <vg4acvsea1tin33d2aomchq2j97e54aski@4ax.com>
NNTP-Posting-Host: p-094.newsdawg.com
User-Agent: MT-NewsWatcher/3.3b1 (PPC Mac OS X)
Xref: news.mathworks.com comp.soft-sys.matlab:161182


In article <vg4acvsea1tin33d2aomchq2j97e54aski@4ax.com>,
 Denis Gilbert <nospam@thank.you> wrote:

> On Fri, 16 May 2003 11:24:12 -0400, "Michael Robbins"
> <michael.robbins@us.cibc.com> wrote:
> 
> 
> >Thanks again for your help. Maybe I coded it wrong, but the results
> >are quite different, though much faster;
> 
> Michael,  
> 
> I tried John's code and obtained good results by changing
> 
>  X = [ones(21,1), (-20:0)'];
> 
> to 
> 
>  X = [ones(21,1),(0 : -1 : -20)'];
> 
> You will also need to decide whether you want to have your slope
> estimates centered or not about your rolling window width. By that I
> mean that if your time unit is years and your last data point
> corresponds to year 2002, do you want your last slope estimate to be
> in year 2002 or centered at 1992, the middle of your latest rolling
> window?  In the latter case you will need to shift back the results by
> windowWidth/2 indices and set to NaN the last windowWidth/2 indices of
> your slope estimate vector.
> 
> Hope this helps,  Denis.
> 

Thanks Denis.

I was sloppy in creating my filter coefficients. 

John