[ENH] AutoETS to ignore multiplicative components when time series is not strictly positive
See original GitHub issueIs your feature request related to a problem? Please describe. If a time series is not strictly positive, ETS models (from statsmodels) with multiplicative components will raise the following error:
ValueError: endog must be strictly positive when usingmultiplicative error, trend or seasonal components.
Currently AutoETS will raise the same error because it tries all the available ETS models. Ideally AutoETS will skip the models that result in this error and will try all the other ones.
Describe the solution you’d like One solution would be to add a try/except in the _fit method. The other solution I can think of is to check whether the time series is strictly positive and if it’s not remove the multiplicative components from _iter.
The following code reproduces the error:
import pandas as pd
import numpy as np
from sktime.forecasting.ets import AutoETS
from sktime.utils.plotting import plot_series
ts = pd.Series(
10*np.sin(np.array(range(0,264))/10)+10,
pd.date_range("2017-01-01", periods=264, freq="W")
)
ts[ts<1]=0
forecaster = AutoETS(auto=True, sp=52, n_jobs=-1, ignore_inf_ic=True)
plot_series(ts)
forecaster.fit(ts)
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
sktime/01_forecasting.ipynb at main - GitHub
A unified framework for machine learning with time series ... 2.3.1 Exponential smoothing, theta forecaster, autoETS from statsmodels ...
Read more >Data Preprocessing and Augmentation for Multiple Short Time ...
This paper describes attempts to use statistical time series algorithms for data preprocessing and augmenting for time series forecasting ...
Read more >Multiplicative Decomposition Time Series Model (TS E4)
Modeling time series can be complicated however in this video I show how to create a simple model using trend and cycle as...
Read more >Time Series Analysis: Introduction & Components of Time ...
The analysis of time series helps in forecasting or projecting the future value of the variable. Components of Time Series. The primary components...
Read more >[ENH] AutoETS to ignore multiplicative components when time ...
If a time series is not strictly positive, ETS models (from statsmodels) with multiplicative components will raise the following error:
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@mloning, I’m sorry for the late reply. The fable version in R seems to check for this error as well so I think the second approach makes sense.
Thanks @HYang1996! So I suggest we implement that check in our version too and add a short note to the docstring.