Select Page

11.3 Time Series Components:   Trend, Seasonality, and Error


Time series data can be broken down into three sub-components:  trend, seasonality, and error. The patterns that a time series exhibits through its trend and the seasonality are the “signal” that allows us to use the series for future predictions, while the error is the “noise”, or random movement from which we cannot infer a pattern or meaning. 

We can use the seasonal_decompose() function from statsmodels to see how a particular variable’s measurements can be broken down into these components.  In the first plot below, we are looking at the ‘RidePax’ variable from Lobsterland’s 2020 data.  This variable depicts the number of unique riders that went on any of Lobster Land’s rides on a particular day.

The second plot here is the trend, which does not show any clear pattern across the series.  The third plot demonstrates clear seasonality in this data, which reflects the weekly pattern of visitors to the park.  Finally, the fourth plot, labeled “Resid” here, depicts the portion of the time series not captured by its trend or seasonality.