https://github.com/nixtla/statsforecast
Lightning ⚡️ fast forecasting with statistical and econometric models.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.6%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Lightning ⚡️ fast forecasting with statistical and econometric models.
Basic Info
- Host: GitHub
- Owner: Nixtla
- License: apache-2.0
- Language: Python
- Default Branch: main
- Homepage: https://nixtlaverse.nixtla.io/statsforecast
- Size: 246 MB
Statistics
- Stars: 4,493
- Watchers: 44
- Forks: 328
- Open Issues: 132
- Releases: 37
Topics
Metadata Files
README.md
Nixtla
Statistical ⚡️ Forecast
Lightning fast forecasting with statistical and econometric models
[](https://github.com/Nixtla/statsforecast/actions/workflows/ci.yaml) [](https://pypi.org/project/statsforecast/) [](https://pypi.org/project/statsforecast/) [](https://anaconda.org/conda-forge/statsforecast) [](https://github.com/Nixtla/statsforecast/blob/main/LICENSE) [](https://github.com/Nixtla/statsforecast/actions/workflows/build-docs.yaml) [](https://pepy.tech/project/statsforecast) **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.Installation
You can install StatsForecast with:
python
pip install statsforecast
or
python
conda install -c conda-forge statsforecast
Vist our Installation Guide for further instructions.
Quick Start
Minimal Example
```python from statsforecast import StatsForecast from statsforecast.models import AutoARIMA from statsforecast.utils import AirPassengersDF
df = AirPassengersDF sf = StatsForecast( models=[AutoARIMA(season_length=12)], freq='ME', ) sf.fit(df) sf.predict(h=12, level=[95]) ```
Get Started quick guide
Follow this end-to-end walkthrough for best practices.
Why?
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.
Features
- Fastest and most accurate implementations of
AutoARIMA,AutoETS,AutoCES,MSTLandThetain Python. - Out-of-the-box compatibility with Spark, Dask, and Ray.
- Probabilistic Forecasting and Confidence Intervals.
- Support for exogenous Variables and static covariates.
- Anomaly Detection.
- Familiar sklearn syntax:
.fitand.predict.
Highlights
- Inclusion of
exogenous variablesandprediction intervalsfor ARIMA. - 20x faster than
pmdarima. - 1.5x faster than
R. - 500x faster than
Prophet. - 4x faster than
statsmodels. - Compiled to high performance machine code through
numba. - 1,000,000 series in 30 min with ray.
- Replace FB-Prophet in two lines of code and gain speed and accuracy. Check the experiments here.
- Fit 10 benchmark models on 1,000,000 series in under 5 min.
Missing something? Please open an issue or write us in
Examples and Guides
📚 End to End Walkthrough: Model training, evaluation and selection for multiple time series
🔎 Anomaly Detection: detect anomalies for time series using in-sample prediction intervals.
👩🔬 Cross Validation: robust model’s performance evaluation.
❄️ Multiple Seasonalities: how to forecast data with multiple seasonalities using an MSTL.
🔌 Predict Demand Peaks: electricity load forecasting for detecting daily peaks and reducing electric bills.
📈 Intermittent Demand: forecast series with very few non-zero observations.
🌡️ Exogenous Regressors: like weather or prices
Models
Automatic Forecasting
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 |Exogenous features| |:------|:-------------:|:----------------------:|:---------------------:|:----------------------------:|:----------------:| |AutoARIMA|✅|✅|✅|✅|✅| |AutoETS|✅|✅|✅|✅|| |AutoCES|✅|✅|✅|✅|| |AutoTheta|✅|✅|✅|✅|| |AutoMFLES|✅|✅|✅|✅|✅| |AutoTBATS|✅|✅|✅|✅||
ARIMA Family
These models exploit the existing autocorrelations in the time series.
|Model | Point Forecast | Probabilistic Forecast | Insample fitted values | Probabilistic fitted values |Exogenous features| |:------|:-------------:|:----------------------:|:---------------------:|:----------------------------:|:----------------:| |ARIMA|✅|✅|✅|✅|✅| |AutoRegressive|✅|✅|✅|✅|✅|
Theta Family
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 |Exogenous features| |:------|:-------------:|:----------------------:|:---------------------:|:----------------------------:|:----------------:| |Theta|✅|✅|✅|✅|✅| |OptimizedTheta|✅|✅|✅|✅|| |DynamicTheta|✅|✅|✅|✅|| |DynamicOptimizedTheta|✅|✅|✅|✅||
Multiple Seasonalities
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 |Exogenous features| |:------|:-------------:|:----------------------:|:---------------------:|:----------------------------:|:----------------:| |MSTL|✅|✅|✅|✅|If trend forecaster supports| |MFLES|✅|✅|✅|✅|✅| |TBATS|✅|✅|✅|✅||
GARCH and ARCH Models
Suited for modeling time series that exhibit non-constant volatility over time. The ARCH model is a particular case of GARCH.
|Model | Point Forecast | Probabilistic Forecast | Insample fitted values | Probabilistic fitted values |Exogenous features| |:------|:-------------:|:----------------------:|:---------------------:|:----------------------------:|:----------------:| |GARCH|✅|✅|✅|✅|| |ARCH|✅|✅|✅|✅||
Baseline Models
Classical models for establishing baseline.
|Model | Point Forecast | Probabilistic Forecast | Insample fitted values | Probabilistic fitted values |Exogenous features| |:------|:-------------:|:----------------------:|:---------------------:|:----------------------------:|:----------------:| |HistoricAverage|✅|✅|✅|✅|| |Naive|✅|✅|✅|✅|| |RandomWalkWithDrift|✅|✅|✅|✅|| |SeasonalNaive|✅|✅|✅|✅|| |WindowAverage|✅||||| |SeasonalWindowAverage|✅|||||
Exponential Smoothing
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 |Exogenous features| |:------|:-------------:|:----------------------:|:---------------------:|:----------------------------:|:----------------:| |SimpleExponentialSmoothing|✅||✅||| |SimpleExponentialSmoothingOptimized|✅||✅||| |SeasonalExponentialSmoothing|✅||✅||| |SeasonalExponentialSmoothingOptimized|✅||✅||| |Holt|✅|✅|✅|✅|| |HoltWinters|✅|✅|✅|✅||
Sparse or Inttermitent
Suited for series with very few non-zero observations
|Model | Point Forecast | Probabilistic Forecast | Insample fitted values | Probabilistic fitted values |Exogenous features| |:------|:-------------:|:----------------------:|:---------------------:|:----------------------------:|:----------------:| |ADIDA|✅||✅|✅|| |CrostonClassic|✅||✅|✅|| |CrostonOptimized|✅||✅|✅|| |CrostonSBA|✅||✅|✅|| |IMAPA|✅||✅|✅|| |TSB|✅||✅|✅||
🔨 How to contribute
See CONTRIBUTING.md.
Citing
bibtex
@misc{garza2022statsforecast,
author={Azul Garza, Max Mergenthaler Canseco, Cristian Challú, Kin G. Olivares},
title = {{StatsForecast}: Lightning fast forecasting with statistical and econometric models},
year={2022},
howpublished={{PyCon} Salt Lake City, Utah, US 2022},
url={https://github.com/Nixtla/statsforecast}
}
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Owner
- Name: Nixtla
- Login: Nixtla
- Kind: organization
- Email: ops@nixtla.io
- Location: United States of America
- Website: https://www.nixtla.io/
- Twitter: nixtlainc
- Repositories: 13
- Profile: https://github.com/Nixtla
Open Source Time Series Ecosystem
GitHub Events
Total
- Create event: 42
- Release event: 3
- Issues event: 55
- Watch event: 523
- Delete event: 33
- Member event: 1
- Issue comment event: 183
- Push event: 177
- Pull request review comment event: 28
- Pull request review event: 50
- Pull request event: 102
- Fork event: 43
Last Year
- Create event: 42
- Release event: 3
- Issues event: 55
- Watch event: 523
- Delete event: 33
- Member event: 1
- Issue comment event: 183
- Push event: 177
- Pull request review comment event: 28
- Pull request review event: 50
- Pull request event: 102
- Fork event: 43
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| FedericoGarza | f****z@g****m | 739 |
| José Morales | j****2@g****m | 144 |
| allcontributors[bot] | 4****] | 58 |
| mergenthaler | m****m@g****m | 55 |
| Kin | k****s@g****m | 38 |
| dependabot[bot] | 4****] | 26 |
| Mariana Menchero García | 4****o | 26 |
| Kevin Kho | k****o@g****m | 12 |
| Akmal Soliev | s****v@g****m | 8 |
| Han Wang | h****g@l****m | 5 |
| Hahnbee Lee | 5****e | 4 |
| shibzhou | s****3@g****m | 4 |
| Akmal Soliev | a****v@n****t | 3 |
| Andrew Scott | 8****m | 3 |
| taniishkaaa | 1****a | 2 |
| Yiben Huang | 6****g | 2 |
| Vaibhav Gupta | 9****t | 2 |
| Sugato Ray | r****o@g****m | 2 |
| Nelson Cárdenas Bolaño | n****8@g****m | 2 |
| Jeroen Bos | j****n@l****c | 2 |
| Manuel Calzolari | m****i@g****m | 2 |
| Manishankar Singh | m****7@g****m | 1 |
| Kyle Schmaus | k****s@g****m | 1 |
| Matheus Fidelis | m****s | 1 |
| Josh Attenberg | j****g@g****m | 1 |
| Chad Parmet | c****t@g****m | 1 |
| Christopher Titchen | 1****n | 1 |
| Cristian | c****u@g****m | 1 |
| westonplatter | w****b@g****m | 1 |
| r | r****l | 1 |
| and 20 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 247
- Total pull requests: 423
- Average time to close issues: 3 months
- Average time to close pull requests: 12 days
- Total issue authors: 173
- Total pull request authors: 58
- Average comments per issue: 1.91
- Average comments per pull request: 1.58
- Merged pull requests: 331
- Bot issues: 1
- Bot pull requests: 73
Past Year
- Issues: 46
- Pull requests: 148
- Average time to close issues: 11 days
- Average time to close pull requests: 3 days
- Issue authors: 37
- Pull request authors: 21
- Average comments per issue: 0.41
- Average comments per pull request: 1.82
- Merged pull requests: 102
- Bot issues: 1
- Bot pull requests: 56
Top Authors
Issue Authors
- nelsoncardenas (9)
- AzulGarza (6)
- FedericoGarza (6)
- Jonathan-87 (5)
- vspinu (5)
- jmoralez (5)
- quant5 (4)
- sammiller06 (4)
- andrewscottm (4)
- GGA-PERSO (4)
- kgboyko (4)
- tackes (4)
- RashidBakirov (3)
- sm-ak-r33 (3)
- Chaptyziok (3)
Pull Request Authors
- jmoralez (141)
- dependabot[bot] (62)
- FedericoGarza (47)
- MMenchero (23)
- allcontributors[bot] (11)
- kvnkho (11)
- akmalsoliev (10)
- deven367 (8)
- andrewscottm (6)
- nepslor (6)
- elephaint (6)
- AzulGarza (5)
- tracykteal (4)
- dimbleby (4)
- mergenthaler (4)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- holidays <0.21
- jupyterlab
- matplotlib
- numba >=0.55.0
- numpy >=1.21.6
- pandas >=1.3.5
- pip
- plotly
- prophet
- pyarrow
- pyspark >=3.3
- scipy >=1.7.3
- statsmodels >=0.13.2
- tabulate
- utilsforecast >=0.0.5
- fire
- numba
- numpy 1.21.4
- pip 20.3.3
- pmdarima
- prophet
- python 3.7.*
- r-base 3.6.3
- r-forecast
- r-furrr
- r-future
- r-future.apply
- r-tidyverse
- r-urca
- scikit-learn
- tabulate
- prophet
- python 3.7.*
- fire
- numba
- numpy 1.21.4
- pip 20.3.3
- pmdarima
- prophet
- python 3.7.*
- r-base 3.6.3
- r-forecast
- r-furrr
- r-future
- r-future.apply
- r-tidyverse
- r-urca
- scikit-learn
- tabulate
- fire
- jupyterlab
- pip 20.3.3
- pyarrow
- python 3.7.*
- fire
- numba
- numpy 1.21.4
- pip 20.3.3
- prophet
- python 3.7.*
- r-base
- r-nloptr
- scikit-learn
- tabulate
- fire
- numba
- numpy 1.21.4
- pip 20.3.3
- pmdarima
- prophet
- python 3.7.*
- r-base 3.6.3
- r-forecast
- r-furrr
- r-future
- r-future.apply
- r-tidyverse
- r-urca
- scikit-learn
- tabulate
- fire
- numba
- numpy 1.21.4
- pip 20.3.3
- pmdarima
- prophet
- python 3.7.*
- r-base 3.6.3
- r-forecast
- r-furrr
- r-future
- r-future.apply
- r-tidyverse
- r-urca
- scikit-learn
- tabulate
- fire
- numba
- numpy 1.21.4
- pip 20.3.3
- python 3.7.*
- scikit-learn
- tabulate
- fire
- numba
- numpy
- pip 20.3.3
- prophet
- python 3.8.*
- fire
- numba
- numpy
- pip 20.3.3
- python 3.8.*
- numpy 1.21.4
- pip 20.3.3
- python 3.7.*
- fire
- numba
- numpy 1.21.4
- pip 20.3.3
- python 3.7.*
- scikit-learn
- tabulate
- actions/checkout v2 composite
- actions/checkout v3 composite
- actions/setup-python v2 composite
- mamba-org/setup-micromamba v1 composite
- fastai/workflows/quarto-ghp master composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- lee-dohm/no-response v0.5.0 composite
- actions/checkout v3 composite
- actions/setup-python v3 composite
- pypa/gh-action-pypi-publish release/v1 composite
- python 3.10 build
- continuumio/miniconda3 4.7.12 build
- continuumio/miniconda3 4.7.12 build
- continuumio/miniconda3 4.7.12 build
- holidays <0.21 development
- jupyterlab * development
- matplotlib * development
- nbdev * development
- numba >=0.55.0 development
- numpy >=1.21.6 development
- pandas >=1.3.5 development
- pip * development
- plotly * development
- plotly-resampler * development
- polars * development
- prophet * development
- scipy >=1.7.3 development
- statsmodels >=0.13.2 development
- supersmoother * development
- tabulate * development
- tqdm * development