# Optimization failure in HoltWinters [closed]

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.

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

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.
• 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() ? – Arushi Nov 24 '14 at 4:56
• 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. – Stephan Kolassa Nov 24 '14 at 7:58