Dealing with multi seasonality in time series

I am new in R and time series analysis and need some help. I am currently trying to create a tool to forecast the demand of power for a company. On my data set I have 17550 observations that correspond to the demand on the last 17550 hours.

My approach to the problem was to try fit a time series with a multi seasonality approach. I tried using Fourier series terms as regressors, and as a first step I am checking the AIC values for certain combinations of the number of terms.

my code so far is:

Demand = head(MyData$Value,-1000) aic_vals_temp <- NULL aic_vals <- NULL y1 <- msts(Demand,seasonal.periods=c(24, 168, 8766),ts.frequency=24) for (i in 1:4) { for (j in 1:4){ for (z in 1:4){ z1 <- fourier(y1, K=c(i,j,z)) fitma1 <- auto.arima(y1,D=0,max.P=0,max.Q=0,xreg=z1) aic_vals_temp <- cbind(i,j,z,fitma1$aic)
aic_vals <- rbind(aic_vals,aic_vals_temp)
}
}
}

I want to test the influence of last day, last week and last year information. Am I doing this correctly so far? I have noticed that it takes a lot of time to get the AIC values.

Thanks a lot for your help in advance.

• Hi Nick, There are acres of literature on multiple time series. Can you tell us a bit more about the precise nature of the multiple seasonality, as the answer will depend on that. – Statsanalyst Oct 6 '17 at 14:09
• i am assuming that the demand for power for this company depends on what happened yesterday, a week ago and a year ago. The assumption is totally arbitrarily. – Nick Barnes Oct 6 '17 at 14:13
• I would say rule number one is don't make arbitrary assumptions. I would suggest that you begin by visually analysing the data to see what the pattern actually is. A simple Excel line chart is the best place to start. I would also suggest that you investigate what the real-world causes of the variation in seasonality are (e.g. - "we spike at 11am because the widget production line runs, then we dip at 12:30 because the operators are having their lunch", etc. Once you've qualitatively analysed the data, then you can think about quantitative modelling. (1 of 2) – Statsanalyst Oct 6 '17 at 14:53
• You might be surprised by how simple the model you need actually is. In any case, you can't say anything sensible about what model you should be using until you understand in broad, non-technical terms, what the seasonality pattern actually is and, ideally, the real-world underlying causes. I will post this as an answer. (2 of 2) – Statsanalyst Oct 6 '17 at 14:57