Documentation
Time-Series Decomposition: trend, weekly pattern and noise
Splits daily clicks or impressions into trend, weekday pattern and residual, labels the direction of the trend and flags days the model cannot explain.
Time-Series Decomposition separates your daily clicks or impressions into three parts: a smoothed trend, a repeating weekday pattern and the residual, which is whatever is left over. It labels the trend as growing, declining or stable, measures the gap between your strongest and weakest weekday, and flags days with an unusually large residual. Use it to tell a real change of direction from the ordinary rhythm of the week.
How the series is split
- A centred 7-day moving average gives a first estimate of the trend.
- Each day's distance from that average is grouped by weekday. The average for each weekday, shifted so that the seven values add up to zero, becomes that weekday's seasonal effect.
- The seasonal effect is taken out of the original series, which gives the Deseasonalised series, and the result is smoothed with the 7-day average applied twice. That smoother line is the trend you see.
- The residual is the original value minus the trend and the seasonal effect. A day whose residual is more than two standard deviations from zero, measured over all residuals, is flagged as an outlier.
This is an additive decomposition: the weekday effect is a number of clicks or impressions, not a percentage. The page header calls it STL, but the method is a classical moving-average decomposition rather than STL's local regression. Forecasting: Principles and Practice explains classical decomposition and how STL differs.
How the trend is labelled
A straight line is fitted through the trend, and its slope is expressed as a percentage of the trend's average level per day:
| Daily slope | Label | Over 30 days |
|---|---|---|
| +0.25% or more | Growing | about +7.5% or more |
| between −0.25% and +0.25% | Stable | within about ±7.5% |
| −0.25% or less | Declining | about −7.5% or more down |
The cards show the label with the trend's first and last value, the daily change with its 30-day equivalent, the Trend change over window from the first day to the last, the Weekly swing (strongest weekday effect minus the weakest, with both days named) and the number of Residual outliers with the residual standard deviation.
Reading the charts
- Original and trend: the daily values with the trend over them.
- Weekly seasonal component: the average distance from the trend for each weekday. Bars above zero are your busier days.
- Deseasonalised series: the data with the weekday effect removed, which makes week-to-week movement easier to read.
- Residuals: what trend and weekday cannot explain, with dashed lines at ±2 standard deviations.
The Daily components table lists every day with its weekday, original value, trend, seasonal effect, residual, residual z and an Outlier flag. Residual outliers lists the flagged days with their actual and expected values. Switch Metric between Clicks and Impressions after a run and the decomposition is redone in the browser.
What it assumes, and its blind spots
- A fixed weekly pattern of a fixed size. If traffic doubles over the window, a weekday swing measured in clicks is too small for the end and too big for the start.
- No yearly cycle. The run covers at least 90 days (shorter ranges are extended backwards, as the note above the results says), which is too short to model seasons. A December dip or a summer lull shows up as trend.
- The ends are less settled. The moving averages shrink near the start and end of the series, so the trend for the most recent week rests on fewer days and will move as new data arrives.
- Outliers pull on the averages. One extreme day shifts its weekday's average and the residual spread; Anomaly Detection uses robust statistics that resist this.
- Missing days count as zero, which a property newer than the window shows as a flat start.
Using what you find
An outlier is a date to explain: a release, an outage, a news mention or a Google ranking update. Add an annotation so the date and its reason appear on the dashboard's trend chart from then on. To date when the level itself moved, run Change Point Detection over the same range.