Trend, Seasonality, and Decomposition
Explore how to break down a time series into trend, seasonality, and residual components to understand underlying patterns in weekly retail sales data. Learn to check time ordering, choose the correct seasonal period, and interpret decomposition results to identify long-term trends and recurring events. This lesson guides you in making sense of time-based data for better analysis and modeling.
Weekly retail sales can rise across a year while also jumping at regular intervals, so an average week hides the question that matters: are sales growing, or are recurring events producing the peaks? Once time becomes central to the data, the order of the observations carries information that a shuffled table would erase.
A time series is a sequence of values indexed by time, such as weekly sales recorded every Monday. The sales total for 2025-01-06 comes before the total for 2025-01-13, and that order lets us inspect change over time.
We will separate a sales series into three drivers:
Trend is the long-run direction, such as a gradual increase from 500 to 700 orders per week.
Seasonality is a pattern that repeats at a fixed interval, such as a sales bump every four weeks.
Residual is the variation left after accounting for trend and seasonality.
Decomposition is the process of separating an observed series into those parts. It helps explain what drove movement in recorded sales. It does not forecast future sales by itself. Forecasting: Principles and Practice describes decomposition as a useful way to identify patterns that later modeling steps must account for.
Inspecting weekly sales before fitting anything
The weekly sales values must have a complete, increasing time index before we interpret their shape. Regular spacing matters because a repeated ...