0
$\begingroup$

I understand that the Holt-Winters' seasonal multiplicative method needs the data to have non-zero values. Accordingly, functions such as statsmodels.tsa.holtwinters.ExponentialSmoothing do not allow for the use of multiplicative seasonality (or trend) if the data contains zeros - or even negative values.

But many seasonal time series do contain zeros, and I would expect it to be possible to use the same methods maybe with some trick to make it work.

In my particular case, I added 0.01 to all entries of my dataset, and then the algorithm ran well with decent results. But it seems fishy.

Is this what one should do, or is it something else?

$\endgroup$
1
$\begingroup$

Yes, it's ideal for there not to be zeroes. I'm not sure what software you're using but there are implementations of exponential smoothing that won't fail just because there's one zero. The results might be wonky (if something is zero 25% of the time, then shifts to 5% of the time, the model might end up showing that as an exponential trend).

Adding a small number to all observations and then subtracting it from the forecast is an acceptable workaround as far as I'm concerned. I have used it in the past when forecasting across many time series, some that had zeroes and some that didn't, and wanting to avoid wonky results on the intermittent ones (which in my case, was okay because by definition a series that had lower values was less important and didn't justify spending a lot of time to improve the model).

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Ok, I guess it's fine then. Not sure what I's do if I had negative numbers like -10 though: one cannot simply add +11 before fitting because for multiplication the scale matters... Maybe take the absolute value but keep track of where it used to be negative? Also: I am using statsmodels.tsa.holtwinters. $\endgroup$ – Soap Mar 19 at 18:13
  • $\begingroup$ Do you have -10? Do you need multiplicative rather than additive? We can get into particulars if you give more details on the data. $\endgroup$ – Chris Umphlett Mar 19 at 18:17
  • $\begingroup$ Thanks. In my particular case I do not have negative numbers but was just wondering what to do if I had! $\endgroup$ – Soap Mar 19 at 20:09
  • $\begingroup$ Negatives are rare in time series forecasts in practice (at least in what I’ve seen). The types of data tend to be positive, or if negative, can just be shifted to positive range. $\endgroup$ – Chris Umphlett Mar 19 at 20:23
0
$\begingroup$

It depends what you are predicting too. I suspect most time series involves currency or number of cases and its impossible to have negative currency or cases (you can decline from period to period, but the number of cases or spending for example won't be negative - in any given period because that is physically impossible.).

I work with ESM a lot and I had never heard until now it can not be zero (our data is not, but I never knew it could not be zero).

| cite | improve this answer | |
$\endgroup$

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.