--- title:
StatsForecast offers a collection of widely used univariate time series forecasting models, including automatic ARIMA
and ETS
modeling optimized for high performance using numba
. It also includes a large battery of benchmarking models.
You can install the released version of StatsForecast
from the Python package index with:
pip install statsforecast
(Installing inside a python virtualenvironment or a conda environment is recommended.)
Also you can install the released version of StatsForecast
from conda with:
conda install -c conda-forge statsforecast
(Installing inside a python virtualenvironment or a conda environment is recommended.)
If you want to make some modifications to the code and see the effects in real time (without reinstalling), follow the steps below:
git clone https://github.com/Nixtla/statsforecast.git
cd statsforecast
pip install -e .
To get started just follow this guide.
auto_arima
in Python
and R
.Fastest and most accurate ets
in Python
and R
.
New!: Replace FB-Prophet in two lines of code and gain speed and accuracy. Check the experiments here.
AutoARIMA().fit(y).predict(h=7)
.exogenous variables
and prediction intervals
for ARIMA.pmdarima
.R
.Prophet
. statsmodels
.numba
.Out of the box implementation of ses
, adida
, historic_average
, croston_classic
, croston_sba
, croston_optimized
, seasonal_window_average
, seasonal_naive
, imapa
naive
, random_walk_with_drift
, window_average
, seasonal_exponential_smoothing
, tsb
, auto_arima
and ets
.
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.
The auto_arima
model implemented in StatsForecast
is 20x faster than pmdarima
and 1.5x faster than R
while improving accuracy. You can see the exact comparison and reproduce the results here.
StatsForecast's exponential smoothing is 4x faster than StatsModels' and 1.6x faster than R's, with improved accuracy and robustness. You can see the exact comparison and reproduce the resultshere
With StatsForecast
you can fit 9 benchmark models on 1,000,000 series in under 5 min. Reproduce the results here.
You can run this notebooks to get you started.
Example of different auto_arima
models on M4 data
auto_arima
.
The auto_arima
model is widely used to forecast time series in production and as a benchmark. However, the alternative python implementation (pmdarima
) is so slow that prevents data scientists from quickly iterating and deploying auto_arima
in production for a large number of time series. Shorter Example of fitting and auto_arima
and an ets
model.
See CONTRIBUTING.md.
auto_arima
model is based (translated) from the R implementation included in the forecast package developed by Rob Hyndman.ets
model is based (translated) from the R implementation included in the forecast package developed by Rob Hyndman.