How to Use Autocorrelation Function (ACF) to Determine Seasonality

In my previous post, I wrote about using the autocorrelation function (ACF) to determine if a timeseries is stationary. Now, let us use the ACF to determine seasonality. This is a relatively straightforward procedure.

Firstly, seasonality in a timeseries refers to predictable and recurring trends and patterns over a period of time, normally a year. An  example of a seasonal timeseries is retail data, which sees spikes in sales during holiday seasons like Christmas. Another seasonal timeseries is box office data, which sees a spike in sales of movie tickets over the summer season. Yet another example is sales of Hallmark cards, which spike in February for Valentine’s Day.

The below graphs show sales of clothing in the UK, and how these sales follow seasonal trends, spiking in the holiday season:

Clothing Sales in the UK

Clothing Sales in the UK

Clothing Sales in the UK: line graph

Clothing Sales in the UK: line graph

Note the spikes in sales, which obediently occur every December, in time for Christmas. This is evident in the trail of December plot points (Graph 1), which hover significantly above the sales data for other months, and also in the actual spikes of the line graph (Graph 2).

The above is a simple example of a seasonal timeseries. However, timeseries are not always simply seasonal. For example, a SARMA process comprises of seasonal, autoregressive, and moving average components, hence the acronym. This will not look as obviously seasonal, as the AR and MA processes may overlap with the seasonal process. Thus, a simple timeseries plot, as shown above, will not allow us to appreciate and identify the seasonal element in the series.

Thus, it may be advisable to use an autocorrelation function to determine seasonality. In the case of seasonality, we will observe an ACF as below:

ACF of UK clothing sales data

ACF of UK clothing sales data

Note that the ACF shows an oscillation, indicative of a seasonal series. Note the peaks occur at lags of 12 months, because April 2011 correlates with April 2012, and 24 months, because April 2011 correlates with April 2013, and so on.

The above analyses were conducted on R. Credits to data.gov.uk and the Office of National Statistics, UK for the data.

Abbas Keshvani

Advertisements

16 thoughts on “How to Use Autocorrelation Function (ACF) to Determine Seasonality

  1. Pingback: How to use the Autocorreation Function (ACF)? | CoolStatsBlog

  2. Dear Abbas,

    Would I please be able to use your ACF function plots for seasonality and stationarity for my dissertation? Just as a point of reference.

    Thanks,
    Jay

  3. Excellent explanations! But I wonder how you can get the information of the peiriod, here 12 month, without read it on the ACF graph? Can you help me? I have a time seires with an unknow period….

  4. Dear Abbas,
    Thanks for explaining usage of ACF to find seasonality. I have two questions
    1) If there exists no seasonality in data, how can it be identified? Since ACF will still give spikes may be with smaller range. What should be cutoff value or threshold value for considering the spike as significant from others. Also does it guarantee presence/ absence of seasonality.?
    2) In real world, datasets would have noise and hence while predicting the period using ACF might take that as well into consideration, because it might affect in computing period.

    Thanks and Regards,
    -Vikrant

    • Thanks Vikrant.

      1. An ACF spike at lags of 4 means that there is a strong correlation between every 4th point. It indicates seasonality. But if the correlation is strong for all points, then it means that the series is just non-stationary or random.

      2. ACF tells you the correlation between every single point and its k-th lag. Noise cannot affect the entire data series to show a false correlation.

  5. Thanks for this explanation. I have two questions.
    1. Can it be said that the ACF plotted above depicts a non-stationary time series?
    2. Is every seasonal time series non-stationary?

  6. This is extremely helpful! I have a question though. How can you tell from your ACF graph whether the time series has additive seasonality or multiplicative?
    I am personally working on some forecasting work and I’ve got a time series that peaks at every 12 months but the size of the oscillations decreases. The original time plot suggests there’s multiplicative seasonality so is this what the ACF plot is confirming?
    Thanks in advance!

  7. Thank you Abbas, for your interesting and useful notes. From the conceptual point of view, it seems that seasonality is a multiplicative component in the process because the seasonality effect depends on the previous amount of signal. I mean additive component are uncorrelated with the original signal yet seasonality is correlated with original signal.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s