Fitting Fourier terms for two seasonal periods
Today let's understand how one series can repeat on two different clocks at once, a fast one and a slow one, and how to fit both into a single ARIMA model with Fourier terms.
Here's the running example. Victoria, the Australian state, records its electricity grid demand every half hour. Average that into hourly totals and take four complete weeks, Monday 2014-06-30 through Sunday 2014-07-27, 672 hours of real demand in megawatts (MW) from the Australian Energy Market Operator.
Plot the hour index, 1 through 672, against that hour's demand.
The line does not settle into one clean repeating wave. It climbs and falls fast, roughly once a day, and riding on top of that a slower shift moves the whole day's shape up and down across the four weeks.
What does it mean for a series to have two seasonal periods?
A seasonal period is the number of observations a series takes before its pattern repeats. Statisticians write that count as m. A monthly series with a yearly rhythm has m = 12: this January looks like last January, twelve observations apart.
This series is hourly, so m counts hours, and the window from the last step already gives you everything you need to work out both of them. It covers 4 complete weeks, Monday through Sunday, 672 hours in total.
There are 24 hours in a day, so the daily pattern has m1 = 24. There are 7 days in a week, each with 24 hours, so the weekly pattern has m2 = 7 x 24 = 168.
Both are true of this same 672-hour series at the same time. It is not a daily series or a weekly series; every one of its hours carries both, its place in that day's rise and fall, and its place in that week's weekday-versus-weekend shift.