Solved – Frequency parameter and its impact on auto.arima results

arimaautomatic-algorithmsrtime series

auto.arima returns two different models weather I define my time series with frequency=1 (default value) or frequency=7 which is the seasonality period for my data (weekly data).

Below the forecasted values when frequency parameter is set to 1.

Forecast results with time series frequency set to 1

And now the forecasted values when frequency parameter is set to 7 (which is the seasonality of the data).

Forecast results with time series frequency set to 7

From the help page (?ts) I can see that the frequency parameter sets "the number of observations per unit of time".

I don’t quite understand what does "unit of time" refers to. Since my time series consists of daily data, my first guess would be that “the number of observations per unit of time” would be 1 since I collect one observation every day. On the other hand, when I define parameter frequency=7, I get better forecasts from auto.arima.

My question is:

  1. What is the true meanning of the frequency parameter? Is it the seasonality period?

Best Answer

The frequency parameter of the time series ts() object the number of observations per season, as mentioned on this article - robjhyndman.com/hyndsight/seasonal-periods.

As my time series is composed by daily observations and because I have weekly seasonality, the frequency parameter must be set to 7. That means, data tends to "repeat itself" every week.