R HoltWinters Prediction Pack - Data Overload Elimination

I use the HoltWinters forecast pack in R to generate forecasts from monthly call volume data.

It works well in most cases, but tends to overload data, especially if there are special periods, for example, changing a step in a call request.

In a recent example, which has a pitch change in average sets of alpha as 0.94, beta as 0 and gamma as 0, which creates an odd prediction.

Month Data 1 7082 2 6407 3 5479 4 5480 5 5896 6 6038 7 5686 8 6126 9 6280 10 6893 11 6028 12 5496 13 3569 14 3383 15 3718 16 3351 17 3340 18 3559 19 3722 20 3201 21 3494 22 2810 23 2611 24 2471 25 7756 26 6922 27 7593 28 6716 29 7278 30 7071 

This is the R script I used

 scandata <-read_csv("525-gash.csv"); pages <-scandata[,2]; myts <-ts(pages , start=c(2015, 1), frequency = 12) myforecast <- HoltWinters (myts, seasonal ="additive", optim.start = c(alpha = 0.2, beta = 0.1, gamma = 0.1)); myholt = predict(myforecast, 12 , prediction.interval = FALSE); plot(myforecast,myholt); 

In comparison, if I set the parameters of exponential smoothing to the standard accepted values ​​- alpha 0.2, beta - 0.1 and gamma - 0.1, I get a much better forecast.

I would still like to use the auto-fit part of the forecast, but I would like to put a range around alpha, beta and gamma.

I am trying to set limits on automatic installation, so alpha should be between 0.1 and 0.5, gamma between 0.1 and 0.3, and gamma between 0.1 and 0.3.

https://stat.ethz.ch/R-manual/R-devel/library/stats/html/HoltWinters.html

It looks like it should be possible by setting

 optim.control = list() 

but I could not find a way to successfully set limits on alpha, beta and gamma to make this work.

Does anyone know how to do this?

+5
source share
1 answer

For multi- HoltWinters optimization of HoltWinters , the L-BFGS-B algorithm is used. For all parameters, you can set lower and upper limits by adjusting the original HoltWinters function.

Editing function:

 fix(HoltWinters) 

changing line 66 of:

enter image description here

to

enter image description here

Close the window and save the changes (this will only affect this session). Run the code as you did before:

 myforecast <- HoltWinters (myts, seasonal ="additive", optim.start = c(alpha = 0.2, beta = 0.1, gamma = 0.1)) 
+2
source

Source: https://habr.com/ru/post/1270267/


All Articles