# Rolling window linear regression

4 messages
Open this post in threaded view
|
Report Content as Inappropriate

## Rolling window linear regression

 Hi Does there exists an efficient way of performing linear regression on rolling windows in R. The exact problem is: We have a dataset of length l. The window size is w. Now, I perform linear regression on window i to (i+w) . Using this model can I perform linear regression over window (i+1) to (i+w+1). Thanks Sid Sent on my BlackBerry® from Vodafone ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Rolling window linear regression

 Thanks, I will try it. Regards Sid Sent on my BlackBerry® from Vodafone -----Original Message----- From: Dennis Murphy <[hidden email]> Date: Wed, 18 Aug 2010 08:46:49 To: <[hidden email]> Subject: Re: [R] Rolling window linear regression This is called kernel-based regression; the most popular version is loess. Try library(sos) findFn('loess') to see some of the various implementations available, including graphics functions. The basic function is loess(); the window width is related to the span = parameter of that function. HTH, Dennis On Wed, Aug 18, 2010 at 2:08 AM, <[hidden email]> wrote: > Hi > > Does there exists an efficient way of performing linear regression on > rolling windows in R. > > The exact problem is: > > We have a dataset of length l. The window size is w. > > Now, I perform linear regression on window i to (i+w) . Using this model > can I perform linear regression over window (i+1) to (i+w+1). > > Thanks > Sid > Sent on my BlackBerry® from Vodafone >______________________________________________ > [hidden email] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help> PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code. >         [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Rolling window linear regression

 The function rollapply() in package "zoo" can be used to run rolling regressions. See the examples in the manual page for a worked example. On Thu, 19 Aug 2010, [hidden email] wrote: > Thanks, I will try it. > > Regards > Sid > Sent on my BlackBerry? from Vodafone > > -----Original Message----- > From: Dennis Murphy <[hidden email]> > Date: Wed, 18 Aug 2010 08:46:49 > To: <[hidden email]> > Subject: Re: [R] Rolling window linear regression > > This is called kernel-based regression; the most popular version is loess. > Try > > library(sos) > findFn('loess') > > to see some of the various implementations available, including graphics > functions. The basic function is loess(); the window width is related to the > span = parameter of that function. > > HTH, > Dennis > > On Wed, Aug 18, 2010 at 2:08 AM, <[hidden email]> wrote: > >> Hi >> >> Does there exists an efficient way of performing linear regression on >> rolling windows in R. >> >> The exact problem is: >> >> We have a dataset of length l. The window size is w. >> >> Now, I perform linear regression on window i to (i+w) . Using this model >> can I perform linear regression over window (i+1) to (i+w+1). >> >> Thanks >> Sid >> Sent on my BlackBerry? from Vodafone >> ______________________________________________ >> [hidden email] mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help>> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html>> and provide commented, minimal, self-contained, reproducible code. >> > > > [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.