Working with Seasonal Time Series

Matters get incrementally more complicated when you have a time series that’s characterized in part by seasonality: the tendency of its level to rise and fall in accordance with the passing of the seasons. We use the term season in a more general sense than its everyday meaning of the year’s four seasons. In the context of predictive analytics, a season can be a day if patterns repeat weekly, or a year in terms of presidential election cycles, or just about anything in between. An eight-hour shift in a hospital can represent a season.

This chapter takes a look at how to decompose a time series so that you can see how its seasonality operates apart from its trend (if any). As you might expect from the material in Chapters 3 and 4, several approaches are available to you.


Simple Seasonal Averages

The use of simple seasonal averages to model a time series can sometimes provide you with a fairly crude model for the data. But the approach pays attention to the seasons in the data set, and it can easily be much more accurate as a forecasting technique than simple exponential smoothing when the seasonality is pronounced. Certainly it serves as a useful introduction to some of the procedures used with time series that are both seasonal and trended, so have a look at the example in Figure 5.1.

The data and chart shown in Figure 5.1 represent the average number of daily hits to a website that caters to fans of the National Football League. Each observation in column D represents the average number of hits per day in each of four quarters across a five-year time span.


Identifying a Seasonal Pattern

You can tell from the averages in the range G2:G5 that a distinct quarterly effect is taking place. The largest average number of hits occurs during fall and winter, when the main 16 games and the playoffs are scheduled. Interest, as measured by average daily hits, declines during the spring and summer months.

The charted data series includes data labels showing which quarter each data point belongs to. The chart echoes the message of the averages in G2:G5: Quarters 1 and 4 repeatedly get the most hits. There’s clear seasonality in this data set.


Calculating Seasonal Indexes

After you’ve decided that a time series has a seasonal component, you’d like to quantify the size of the effect. The averages shown in Figure 5.2 represent how the simple-averages method goes about that task.