1
$\begingroup$

I am trying to understand what could be causing these strange values to appear on applying a Holt model to a vector. The data represents actual sales of an item.

library(forecast)

sdata<-c(1955651,1691857,1617358,1509591,1452025,1387790,1630114,3522984,3322908,2315689,
4044634,11553435,9747305,5289976,3905946,1646080,1356731,1248135,1150756,848804,847815,
940673,1129751)

> holt(sdata)
Point Forecast         Lo 80         Hi 80          Lo 95         Hi 95
24  6.144027e+122 6.144014e+122 6.144041e+122  6.144007e+122 6.144048e+122
25  6.144033e+122 4.502199e+122 7.785866e+122  3.633064e+122 8.655001e+122
26  6.144038e+122 3.822133e+122 8.465942e+122  2.592991e+122 9.695084e+122
27  6.144043e+122 3.300300e+122 8.987785e+122  1.794914e+122 1.049317e+123

This involves an exercise where a very large number of forecasts has to be generated. This is merely an attempt to find errors before the forecast is run across all the data. A number of records generated such strange records. I am sure there is a good explanation behind why we see such data.

Note that the data was coerced to a ts object prior to the model being applied on the same (and produced similar results)

Thanks in advance.

$\endgroup$
  • 2
    $\begingroup$ Looks like a new bug. I'll look into it. $\endgroup$ – Rob Hyndman Apr 12 '14 at 1:47
2
$\begingroup$

Prof. Hyndman is as an expert on this. But if you change the method used for selecting initial state values (i.e. initial argument) to "simple" then it works well as follows:

> library(forecast)
> sdata<-c(1955651,1691857,1617358,1509591,1452025,1387790,1630114,3522984,3322908,2315689,
+ 4044634,11553435,9747305,5289976,3905946,1646080,1356731,1248135,1150756,848804,847815,
+ 940673,1129751)
> f=holt(sdata,initial=c("simple"))
> f
   Point Forecast    Lo 80   Hi 80     Lo 95    Hi 95
24         865957 -1748445 3480359  -3132425  4864339
25         602163 -3095159 4299485  -5052404  6256730
26         338369 -4189908 4866646  -6587032  7263770
27          74575 -5154228 5303378  -7922190  8071340
28        -189219 -6035199 5656761  -9129874  8751436
29        -453013 -6856963 5950937 -10247010  9340984
30        -716807 -7633864 6200250 -11295532  9861918
31        -980601 -8375246 6414044 -12289734 10328532
32       -1244395 -9087600 6598810 -13239542 10750752
33       -1508189 -9775653 6759275 -14152184 11135806
> plot(f)

enter image description here

$\endgroup$
  • 3
    $\begingroup$ Even better, use ets(sdata, model="AAN") which is equivalent to Holt's method. $\endgroup$ – Rob Hyndman Apr 13 '14 at 10:11

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.