I am trying to figure out how to implement a cyclic running Regression Line computing algorithm using Least Squares for streaming time series data in the most efficient way. In other words, having $LS(s)$ im looking for a way to compute $LS(s)$ after adding an element to s and removing the kth oldest element from it.
Given a set $s$ of $x,y$ samples I was thinking maybe it is possible to compute $LS(s\bigcup\{a\})$ (for some new sample $a$) and $LS(s-\{a\})$ (for some sample $a$ in $s$, specifically the oldest sample) given $LS(s)$, is there a known solution to this?