I don't have a strong background in statistics, but I'm a programmer and needed to implement some statistical aggregate functions in the DSL I'm writing. This DSL processes events in an online fashion, with sub-linear memory constraints.

I've come across these posts by John D. Cook and implemented both structures.

The second post is about implementing the online linear regression. I did it, and it seems to have consistent results with all implementations I've found on the internet.

But, looking for more info on it, I saw this question here on this site. And most answers seem to agree that it is not possible to compute running the linear regression. I find this a little confusing since I have an actual implementation that does so.

So, that's the question: is it possible to implement running/online linear regression? If not, what is wrong with the method I implemented?

  • 4
    $\begingroup$ You may be misunderstanding the question you reference. The answers there clearly state that online OLS works and there are efficient algorithms (rapid updating with constant memory requirements). The cautionary notes concern logistic regression, which is a completely different algorithm in which a nonlinear function must be minimized. About all one can hope for in that case is that after updating the data, a restart of the optimization at the previous solution will converge quickly to a global minimum--but that is not guaranteed and it's easy to cook up counterexamples. $\endgroup$ – whuber Jul 29 '15 at 13:18
  • 1
    $\begingroup$ I guess @whuber is right. Reading more carefully the question made it clearer to me. I'll just accept it as duplicated. Thanks :) $\endgroup$ – Juan Lopes Jul 29 '15 at 13:29