Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Theta model NaN predictions #655

Closed
hrzn opened this issue Dec 2, 2021 · 1 comment
Closed

Fix Theta model NaN predictions #655

hrzn opened this issue Dec 2, 2021 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@hrzn
Copy link
Contributor

hrzn commented Dec 2, 2021

Currently the Theta model sometimes predicts NaN values. This probably happens when self.season_period is equal to 0, because at some point we divide by it to get the forecast.

Another reason is that the alpha coeff of the SES is equal to 0. One trick to resolve that, is to fix the inital_level during the fit of the SES

@hrzn hrzn added bug Something isn't working good first issue Good for newcomers labels Dec 2, 2021
@madtoinou
Copy link
Collaborator

madtoinou commented Nov 11, 2022

Hi,
After inspecting the code I noticed that, the initial_level of the SES is set to 0.2 and the "reseasonalization" (where the division by self.season_period occurs) happens only if self.season_period is greater than 1. Even if the user "intentionally" sets it to 0, the "reseasonalization" does not take place thanks to the self.is_seasonal attribute.

This make me believe that this issue was addressed in another PR and could probably be closed.

[EDIT]: Found the commit fixing the issue and the corresponding PR #123.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants