# Detecting seasonality from periodogram and seasonplots

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:

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.

The stl() decomposotion shows yearly seasonality.

The ACF and PACF of the non-differenced data.

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

• Have you tried using stl() and acf() / pacf()? – user2974951 Oct 24 '18 at 5:47
• Yes, but they give contradicting results. stl() returns yearly seasonality, while acf() on differenced ts show peaks at lags 30 and 31. – Michieldo Oct 24 '18 at 7:29
• Include all these plots in the qeustion (on the original non-differenced time series!). – user2974951 Oct 24 '18 at 7:35
• 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)? – Ben Oct 24 '18 at 9:00
• 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/… – Michieldo Oct 24 '18 at 9:58