I want to determine whether a time series contains seasonality, and if so, what the periodicity is so I can include this as Fourier terms in my model. Because I have to do this for approximately 100 different univariate series and don't want to inspect them all intensively, I use the tbats() function to check if the result contains seasonal component.

For the series that contained a seasonal component, I looked at the power spectrum of the differenced data to determine the periodicity as suggested by whuber♦ inWhat method can be used to detect seasonality in data?.

For one of the ts consisting of weekly data for a period of two years the spectrum plot produced by spectrum(diff(ts), log = "no", span = c(3, 5)) of the differenced data looks as follows: Periodogram differenced data

I am having a hard time figuring out what the periodicity of this series is, i.e. how to read this plot. At what level on the spectrum is a peak considered high enough to include it as a seasonal component? The function findfrequency() returns a frequency of 3.

I didn't get much wiser from the seasonplot on the differenced data either. enter image description here

The stl() decomposotion shows yearly seasonality. enter image description here

The ACF and PACF of the non-differenced data. ACF and PACF

ACF has peaks at lags higher than 52/53 weeks.

  • 1
    $\begingroup$ Have you tried using stl() and acf() / pacf()? $\endgroup$ – user2974951 Oct 24 '18 at 5:47
  • $\begingroup$ Yes, but they give contradicting results. stl() returns yearly seasonality, while acf() on differenced ts show peaks at lags 30 and 31. $\endgroup$ – Michieldo Oct 24 '18 at 7:29
  • $\begingroup$ Include all these plots in the qeustion (on the original non-differenced time series!). $\endgroup$ – user2974951 Oct 24 '18 at 7:35
  • $\begingroup$ Your periodogram looks wrong - it shows a "frequency" axis with values from 0-25, which substantially exceeds the Nyquist frequency. Are you sure this axis isn't showing the period (i.e., inverse of the frequency)? $\endgroup$ – Ben Oct 24 '18 at 9:00
  • $\begingroup$ I used the spectrum() function from [stats v3.5.1][1] package which takes (-frequency(x)/2, +frequency(x)/2] as the range on the x-axis. Since it is a weekly ts, 0-25 makes sense, but I'm not sure about the interpretation. [1]:rdocumentation.org/packages/stats/versions/3.5.1/topics/… $\endgroup$ – Michieldo Oct 24 '18 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.