Seasonal Effects

Seasonal effect are the repeating patterns in our data that we expect to occur in equal intervals over time. This could be the sales of a business during a certain month or the daily temperatures for a certain time of the year. In this section we will cover a couple techniques that can be used to account for these seasonal patterns.

Fixed Seasonal Effects

Fixed seasonal effects mean the seasonal effect remains the same over time. This means they occur at the same time and have the same effect. Two methods that can account for fixed seasonal effects is the use of binary variables and trigonometric functions.

Binary Variables

We already learned one method to address the seasonality in our time series which was the use of binary variables. By creating a variable we can indicate what seasonal event is taking place. For instance, if we are predicting the number of hurricanes we could add a variables with 1’s during months that have been known to have a large number of hurricanes, and 0’s for the remaining months. Another option would be to create a categorical variable representing each month of the year. This would allow the chance of a hurricane to be adjusted depending on which month it is.

\(y_{t}=b_{0} + b_{1}*Jan + b_{2}*Feb + b_{3}*Mar + b_{4}*Apr + b_{5}*May + b_{6}*Jun + b_{7}*Jul + b_{8}*Aug + b_{9}*Sep + b_{10}*Oct + b_{11}*Nov + \epsilon_{t}\)

Trigonometric Functions

Trigonometric functions is another way to model the seasonal component of our time series. It works by building a formula using trigonometric functions which then emulate the flow of the seasonal effect.

\(g(t)=a\ sin(ft+b)\)

a- amplitude (max-min)/2

f- frequency (number of cycles in 0,2\(\pi\))

b- phase shift

\(S_{t}=a\ sin(ft+b)=\sum_{i=1}^{m} b_{1i}sin(f_{i}t)+b_{2i}cos(f_{i}t)\)

\(f_{i}=2\pi /SB\)

\(y_{t}=b_{0}+\sum_{i=1}^{m} b_{1i}sin(f_{i}t)+b_{2i}cos(f_{i}t)+\epsilon_{t}\)

m- number of trigonometric functions, \(m\le SB/2\)

Each m adds an additional two predictors. The value of m can be chosen using a partial F-test to compare different models. (James et al.)

Changing Seasonal Effect

Sometimes seasonal effects will not remain constant over time and instead can exhibit some kind of trend. One model that can handle this type of data is the seasonal auto regressive model.

Seasonal Autoregressive Models

Seasonal autoregressive models work in the same manner as autoregressive models where they make predictions based on the past values of y. Both are based on the concept of autocorrelation. However, autoregressive models use the nearest past observations, while seasonal autoregressive models use the observations that are the length of the seasonal effect away. For instance, for monthly data if we expect last January to be a good predictor for this January we could use a lagged value of 12. This would mean each prediction is based off the value of y from 12 intervals ago. (James et al.)

Seasonal autoregressive models can skip the lagged values in between and only include 12, while autoregressive models use the closest past observation, then the one after that, and etc until reaching 12.

Seasonal Autoregressive:

\(y_{t}=\beta_{0}+\beta_{1}y_{t-SB}+\beta_{2}y_{t-2SB}+...+B_{P}y_{t-PSB}+\epsilon_{t}\)

Compared to Autoregressive:

\(y_{t}=b_{0}+b_{1}y_{t-1}+b_{2}y_{t-2}+...+b_{12}y_{t-12}+\epsilon_{t}\)

A SAR(1), or seasonal autoregressive model of order 1, uses only one lag to predict future observations. The seasonal base is the number of intervals until a full rotation is complete.

An example for quarterly sales of a business would use a seasonal base of 4. If a SAR(1) uses only the quarterly data from 4 quarters ago:

\(y_{t}=b_{0}+b_{1}y_{t-4}+\epsilon_{t}\)

For quarterly sales of a SAR(2) model the equation would be:

\(y_{t}=b_{0}+b_{1}y_{t-4}+b_{2}y_{t-8}+\epsilon_{t}\)

Each coefficient uses a lag that is the seasonal base away which is 4 here because the data is recorded quarterly.

Sources:

James, G., Witten, D., Hastie, T., & Tibshirani, R. (n.d.). An introduction to statistical learning: With applications in R.