Path: news.mathworks.com!newsfeed!pln-e!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 09:11:47 -0400
Organization: Eastman Kodak Company
Lines: 18
Message-ID: <derrico-78F3FA.09114716052003@news.newsguy.com>
References: <eebdf1d.-1@WebX.raydaftYaTP>
NNTP-Posting-Host: p-546.newsdawg.com
User-Agent: MT-NewsWatcher/3.3b1 (PPC Mac OS X)
Xref: news.mathworks.com comp.soft-sys.matlab:161146


In article <eebdf1d.-1@WebX.raydaftYaTP>,
 "Michael Robbins" <michael.robbins@us.cibc.com> wrote:

> Has anyone come up with a vectorized rolling linear regression or
> robust linear regression?

This would be easy to write as a filter, at least for the
linear regression case. Something like this:

X = [ones(21,1),(-20:0)'];

filtercoef=pinv(X);

intercept_coef=filter(filtercoef(1,:),1,y);
slope_coef=filter(filtercoef(2,:),1,y);

HTH,
John D'Errico