We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The seasonal naive confidence interval for the last time in the forecasted horizon is used for all times.
statsforecast/python/statsforecast/models.py
Line 3305 in 12f6654
Should be k = np.floor(np.arange(h) / self.season_length) as in the R version.
k = np.floor(np.arange(h) / self.season_length)
When the time horizon increases, the first forecasted time's confidence interval increases. It should be constant.
statsforecast 1.7.6 pandas 2.2.2 Python 3.11.9 (main, Apr 19 2024, 11:44:45) [Clang 14.0.6 ] MacOS 14.6.1
import pandas as pd from statsforecast import StatsForecast from statsforecast.models import SeasonalNaive df = pd.DataFrame({ 'unique_id': '0', 'ds': pd.date_range(start='2000-01-01', periods=10, freq='1D'), 'y': [1., 4., 5., 5., 1., 4., 5., 5., 7., 3.] }) m = StatsForecast(models=[SeasonalNaive(season_length=7)], freq='1D', n_jobs=1, verbose=True) m.fit(df=df) print(m.predict(h=1, level=[95]).iloc[0, :]) print(m.predict(h=8, level=[95]).iloc[0, :]) print(m.predict(h=15, level=[95]).iloc[0, :])
unique_id 0 ds 2000-01-11 00:00:00 SeasonalNaive 5.0 SeasonalNaive-lo-95 -1.093776 SeasonalNaive-hi-95 11.093776
unique_id 0 ds 2000-01-11 00:00:00 SeasonalNaive 5.0 SeasonalNaive-lo-95 -3.6179 SeasonalNaive-hi-95 13.6179
unique_id 0 ds 2000-01-11 00:00:00 SeasonalNaive 5.0 SeasonalNaive-lo-95 -5.554729 SeasonalNaive-hi-95 15.554729
Medium: It is a significant difficulty but I can work around it.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
What happened + What you expected to happen
The seasonal naive confidence interval for the last time in the forecasted horizon is used for all times.
statsforecast/python/statsforecast/models.py
Line 3305 in 12f6654
Should be
k = np.floor(np.arange(h) / self.season_length)
as in the R version.When the time horizon increases, the first forecasted time's confidence interval increases. It should be constant.
Versions / Dependencies
statsforecast 1.7.6
pandas 2.2.2
Python 3.11.9 (main, Apr 19 2024, 11:44:45) [Clang 14.0.6 ]
MacOS 14.6.1
Reproducible example
unique_id 0
ds 2000-01-11 00:00:00
SeasonalNaive 5.0
SeasonalNaive-lo-95 -1.093776
SeasonalNaive-hi-95 11.093776
unique_id 0
ds 2000-01-11 00:00:00
SeasonalNaive 5.0
SeasonalNaive-lo-95 -3.6179
SeasonalNaive-hi-95 13.6179
unique_id 0
ds 2000-01-11 00:00:00
SeasonalNaive 5.0
SeasonalNaive-lo-95 -5.554729
SeasonalNaive-hi-95 15.554729
Issue Severity
Medium: It is a significant difficulty but I can work around it.
The text was updated successfully, but these errors were encountered: