Solved – Dealing with multi seasonality in time series

fourier transformmultiple-seasonalitiesrtime 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.

Best Answer

What you need to do is to identify whether or not there is an hourly effect , a daily effect, a monthly effect , a day-of-the-month effect , a week-of-the-month effects, lead and lag effects around holidays , long-weekend effects , level shifts , multiple trends and of course memory effects. All of this has to be simultaneously while taking into account pulses and possible changes in model error variance over time. http://autobox.com/cms/index.php/afs-university/intro-to-forecasting/doc_download/53-capabilities-presentation slide 41- may help you understand this kind of approach. This is always easier when there is domain knowledge about possibly known other external events that may have contributed to variation.

Related Question