Nixtla / statsforecast
- воскресенье, 4 декабря 2022 г. в 00:37:42
Lightning ⚡️ fast forecasting with statistical and econometric models.
StatsForecast offers a collection of widely used univariate time series forecasting models, including automatic ARIMA
, ETS
, CES
, and Theta
modeling optimized for high performance using numba
. It also includes a large battery of benchmarking models.
You can install StatsForecast
with:
pip install statsforecast
or
conda install -c conda-forge statsforecast
Vist our Installation Guide for further instructions.
Minimal Example
from statsforecast import StatsForecast
from statsforecast.models import AutoARIMA
sf = StatsForecast(
models = [AutoARIMA(season_length = 12)],
freq = 'M'
)
sf.fit(df)
sf.predict(h=12, level=[95])
Get Started with this quick guide.
Follow this end-to-end walkthrough for best practices.
Current Python alternatives for statistical models are slow, inaccurate and don't scale well. So we created a library that can be used to forecast in production environments or as benchmarks. StatsForecast
includes an extensive battery of models that can efficiently fit millions of time series.
AutoARIMA
, AutoETS
, AutoCES
, MSTL
and Theta
in Python..fit
and .predict
.exogenous variables
and prediction intervals
for ARIMA.pmdarima
.R
.Prophet
.statsmodels
.numba
.Missing something? Please open an issue or write us in
Automatic forecasting tools search for the best parameters and select the best possible model for a group of time series. These tools are useful for large collections of univariate time series.
Model | Point Forecast | Probabilistic Forecast | Insample fitted values | Probabilistic fitted values |
---|---|---|---|---|
AutoARIMA | ||||
AutoETS | ||||
AutoCES | ||||
AutoTheta |
fit two theta lines to a deseasonalized time series, using different techniques to obtain and combine the two theta lines to produce the final forecasts.
Model | Point Forecast | Probabilistic Forecast | Insample fitted values | Probabilistic fitted values |
---|---|---|---|---|
Theta | ||||
OptimizedTheta | ||||
DynamicTheta | ||||
DynamicOptimizedTheta |
Suited for signals with more than one clear seasonality. Useful for low-frequency data like electricity and logs.
Model | Point Forecast | Probabilistic Forecast | Insample fitted values | Probabilistic fitted values |
---|---|---|---|---|
MSTL |
Classical models for establishing baseline.
Model | Point Forecast | Probabilistic Forecast | Insample fitted values | Probabilistic fitted values |
---|---|---|---|---|
HistoricAverage | ||||
Naive | ||||
RandomWalkWithDrift | ||||
SeasonalNaive | ||||
WindowAverage | ||||
SeasonalWindowAverage |
Uses a weighted average of all past observations where the weights decrease exponentially into the past. Suitable for data with clear trend and/or seasonality. Use the SimpleExponential
family for data with no clear trend or seasonality.
Model | Point Forecast | Probabilistic Forecast | Insample fitted values | Probabilistic fitted values |
---|---|---|---|---|
SimpleExponentialSmoothing | ||||
SimpleExponentialSmoothingOptimized | ||||
SeasonalExponentialSmoothing | ||||
SeasonalExponentialSmoothingOptimized | ||||
Holt | ||||
HoltWinters |
Suited for series with very few non-zero observations
Model | Point Forecast | Probabilistic Forecast | Insample fitted values | Probabilistic fitted values |
---|---|---|---|---|
ADIDA | ||||
CrostonClassic | ||||
CrostonOptimized | ||||
CrostonSBA | ||||
IMAPA | ||||
TSB |
See CONTRIBUTING.md.
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!