Hacker News new | ask | show | jobs
by rubyfan 1988 days ago
Same, the difference I had in my implementation was an added an 8 week moving average. This worked for most of the year and I think even holidays. What was considered normal for the week of Thanksgiving would not be considered normal for a summer week. This was relatively easy using SQL CTEs and windowing functions.

I also separately used a package in R called bsts (Bayesian Structural Time Series) for a different way of projecting seasonality on a trend to find an acceptable normal range. If the actual fell out of range then it was an anomaly. Great write up on the technique by Kim Larsen here: https://multithreaded.stitchfix.com/blog/2016/04/21/forget-a...