BalysLTU
BalysLTU

Reputation: 21

How can I apply Seasonal Exponential Smoothing forecasting method to hourly data in R

I am trying to forecast next-day hourly electricity prices for 2016 using the exponential smoothing method. The data-set that I am using contains hourly price data for the period 2014-01-01 00:00 to 2016-12-31 23:00. My goal is to reproduce the results in Beigaitė & Krilavičius (2018)

As electricity price data exhibits multiple seasonalities (daily, weekly, and yearly), I have defined a msts object for the period 2014-01-01 to 2015-12-31

msts.elspot.prices.2014_2015 <- msts(df.elspot.prices.2014_2015$Price, seasonal.periods = c(24, 168, 8760), ts.frequency = 8760, start = 2014)

I want to use this msts object to forecast the next day (2016-01-01) hourly electricity prices using the hw() function from the forecast package and store the point forecasts in the data frame containing the actual hourly electricity prices for the year 2016.

df.elspot.prices.2016$pred.hw <- hw(msts.elspot.prices.2014_2015, h = 24)$mean

However, I am unable to use the hw() function as I get the following error message:

Error in ets(x, "AAA", alpha = alpha, beta = beta, gamma = gamma, phi = phi,  : `
Frequency too high

After looking online, it appears that the ets() function can only accept the parameter frequency to be max 24. As I am working with hourly data, this is much far below the frequency of my data.

Is there a way I can achieve my desired results using the hw() function? Are there any other packages/functions that could help me achieve my desired results?

I appreciate your help!

Upvotes: 1

Views: 836

Answers (1)

BalysLTU
BalysLTU

Reputation: 21

After looking a bit more, I've came across this question where a user wanted to use the hw method to forecast half-hourly electricity demand using the taylor dataset available in the forecast package.

As Professor Rob Hyndman suggest in the response to the linked question, the double seasonal Holt Winters model method dshw from the forecast package can be used to deal with half-hourly data.

After removing the yearly seasonality parameter (seasonal.periods = 8760) in the definition of my msts object, I've ran the model and it provided a pretty accurate result.

Upvotes: 1

Related Questions