I have a data set of electricity spot prices, which contains three kinds of seasonality: one within 24 hours, one within a week and one within a year.

I want to use an R package (tsDyn) which can't cope with seasonality, so first I would like to remove all three seasonalities, then adapt a model to the deseasonalized data, perform a forecast and then add the seasonalities, if it is possible, in order to transform my forecasts to reasonable form.

Is this approach sensible and possible? And if yes, how could I accomplish this triple deseasonalization and then undo it within R? In the case of a simple one lag differencing I would just undo the seasonal differencing with 'cumsum()', but is something like this applicable for my data set?


Possible yes, sensible no from most time series perspectives.

The main problem with your approach is an apparent assumption that removal of seasonality is, or should be, a trivial matter. But in practice most modern procedures require some kind of estimation of seasonal components based on some choice(s) on how to model it, especially because seasonal components usually vary from year to year. Conversely, if your seasonal components are essentially deterministic, this would be trivial.

Weeks are especially awkward as they don't nest in years.

If you are primarily interested in methods that ignore seasonality, datasets with major seasonality don't seem pertinent. Why make the problem more difficult than it is already?

  • $\begingroup$ Do I have to accept that with my kind of data I cannot use such packages? It's not satisfactory... $\endgroup$ – DatamineR Aug 27 '13 at 18:15
  • $\begingroup$ That's virtually a new question in itself. But where lies the blame? On the programmer whose program doesn't do something (that it was possibly never intended to do)? On the user who would rather that the program was more versatile than it is? As @Rob Hyndman exemplified, there are many programs (functions, commands, routines) that do offer facilities for handling seasonality. $\endgroup$ – Nick Cox Aug 27 '13 at 18:19

You would find it easier to use the tbats() function in the forecast package. It will estimate the seasonality and produce the forecasts.

  • $\begingroup$ The thing is, I am writing a working paper about different forecasting methods. I will make extensive use of the package forecast, but I also need other methods. But some packages don't offer seasonal options, so I wanted to first filter all seasonality out and then "add" it to forecasted values of deseasonalized time series. Is this approach sensible? And if yes, I would be very grateful for a hint how I can do this in the R environment! $\endgroup$ – DatamineR Aug 27 '13 at 13:55
  • 1
    $\begingroup$ @JohnnyB you could use the fourier function to create a matrix of Fourier terms, and include them as external regressors in your forecasting functions. If your function doesn't support external regressors, I suppose you could try some kind of 2-step process. $\endgroup$ – Zach Aug 27 '13 at 14:33
  • $\begingroup$ @Zach Sounds interesting! Then I would need a three column matrix, one column per seasonal component? $\endgroup$ – DatamineR Aug 27 '13 at 14:45

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.