Skip to content

BUG: ExponentialSmoothing fails with ZeroDivisionError #4796

Closed

Description

@abhishekkaranth

For the model parameters
ExponentialSmoothing(arr, trend='add', damped=False, seasonal='add', seasonal_periods=5)
where len(arr) = 12, the fit of model fails with ZeroDivisionError.

The issue is caused while calculating aicc of the model since it is calculated as:

k = m * seasoning + 2 * trending + 2 + 1 * damped
aicc = aic + (2 * (k + 2) * (k + 3)) / (self.nobs - k - 3)

In this case:

self.nobs = 12
k = 9

This can happen with other dataset as well.
Should the model fail in such cases? Even if yes, we can throw better errors I feel.

Activity

  1. ChadFulton commented on Jul 13, 2018

    @ChadFulton
    Member

    Thanks for the report! Yes, I think that in this case the model should run, and we can set the aicc to np.inf.

  2. changed the title [-]ExponentialSmoothing fails with ZeroDivisionError[/-] [+]BUG: ExponentialSmoothing fails with ZeroDivisionError[/+] on Jul 14, 2018
  3. added this to the 0.10 milestone on Jul 14, 2018
  4. added 2 commits that reference this issue on Aug 7, 2018
    156b293
    63112cc
  5. added a commit that references this issue on Dec 23, 2018
    dacbbe1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions