Constant time recursive filter for moving linear regression. Works for any window size k. Formula in the first comment.

Source: [Hacker News](https://news.ycombinator.com/item?id=48552929)

Sponsored