1
$\begingroup$

I am using HoltWintersto fit the exponential model on the data. The data shows trend as well as seasonal pattern.Getting the following error message:

holt_output<-HoltWinters(data)

Error in HoltWinters(data) : optimization failure

Not able to figure it out, why getting the above error.Would appreciate any kind of help.Thanks in advance.

$\endgroup$
  • $\begingroup$ This is about an issue w/ R, not an issue w/ statistics. Please add a reproducible example & we will migrate it for you. $\endgroup$ – gung - Reinstate Monica Nov 23 '14 at 21:14
  • 4
    $\begingroup$ This question appears to be off-topic because it is about an error message in R without a reproducible example. $\endgroup$ – gung - Reinstate Monica Nov 23 '14 at 21:14
  • $\begingroup$ Would you suggest me to move this question to Stack Overflow? $\endgroup$ – Arushi Nov 24 '14 at 4:58
  • 1
    $\begingroup$ StackOverflow would be better, but you would be expected to provide a minimal working example there. $\endgroup$ – Stephan Kolassa Nov 24 '14 at 7:59
4
$\begingroup$

The internal optimization in HoltWinters() ran into a numerical problem. That happens. I suggest you try ets() from the forecast package, which will also fit exponential smoothing models, albeit in a state space framework.

ets() will (attempt to) automatically choose the best model form, but if you insist on having an additive level-and-trend model, you can call ets(y=data,model="AAN"). See ?ets.

$\endgroup$
  • $\begingroup$ thanks for the response. The reason why I am using HoltWinters() is that, it is giving better result that ets() ( MAPE is less ). Is there a way to get the same model in ets() suggested by HoltWinters() ? $\endgroup$ – Arushi Nov 24 '14 at 4:56
  • $\begingroup$ You can't get the exact same model, but the difference should usually be minor. If the MAPE (out-of-sample, right? in-sample goodness of fit is no indicator of forecasting performance) differs systematically by a nontrivial amount between ets(data,model="AAN") and HoltWinters(data), then something is strange. $\endgroup$ – Stephan Kolassa Nov 24 '14 at 7:58

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