Gentlemans as 274 algorithm allows weights, so adding an obs with a weight of -1 would do the trick of removing obs, too.
This may be a good job for hadwell wickhams c code interface. On May 27, 2013 12:47 PM, "Berend Hasselman" <b...@xs4all.nl> wrote: > > On 27-05-2013, at 17:12, ivo welch <ivo.we...@anderson.ucla.edu> wrote: > > > dear R experts---I would like to update OLS regressions with new > > observations on the front of the data, and delete some old > > observations from the rear. my goal is to have a "flexible" > > moving-window regression, with a minimum number of observations and a > > maximum number of observations. I can keep (X' X) and (X' y), and add > > or subtract observations from these two quantities myself, and then > > use crossprod. > > > > strucchange does recursive residuals, which is closely related, but it > > is not designed for such flexible movable windows, nor primarily > > designed to produce standard errors of coefficients. > > > > before I get started on this, I just wanted to inquire whether someone > > has already written such a function. > > > > For regression one would use a QR decomposition. > There is an opensource Fortran library qrupdate ( > http://sourceforge.net/projects/qrupdate/) that can update an unpivoted > QR decomposition for the case of deleting rows/columns and inserting > rows/columns. > > It could be used to make an R package, which could be used for doing a > moving window regression. > Quite a lot of work. > > Berend > > > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org 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.