# statsforecast **Repository Path**: iamdafu/statsforecast ## Basic Information - **Project Name**: statsforecast - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-10-13 - **Last Updated**: 2025-10-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Nixtla [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Statistical%20Forecasting%20Algorithms%20by%20Nixtla%20&url=https://github.com/Nixtla/statsforecast&via=nixtlainc&hashtags=StatisticalModels,TimeSeries,Forecasting) [![Slack](https://img.shields.io/badge/Slack-4A154B?&logo=slack&logoColor=white)](https://join.slack.com/t/nixtlacommunity/shared_invite/zt-1pmhan9j5-F54XR20edHk0UtYAPcW4KQ) [![All Contributors](https://img.shields.io/badge/all_contributors-32-orange.svg?style=flat-square)](#contributors-)

Statistical ⚑️ Forecast

Lightning fast forecasting with statistical and econometric models

[![CI](https://github.com/Nixtla/statsforecast/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/Nixtla/statsforecast/actions/workflows/ci.yaml) [![Python](https://img.shields.io/pypi/pyversions/statsforecast)](https://pypi.org/project/statsforecast/) [![PyPi](https://img.shields.io/pypi/v/statsforecast?color=blue)](https://pypi.org/project/statsforecast/) [![conda-nixtla](https://img.shields.io/conda/vn/conda-forge/statsforecast?color=seagreen&label=conda)](https://anaconda.org/conda-forge/statsforecast) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/Nixtla/statsforecast/blob/main/LICENSE) [![docs](https://github.com/Nixtla/statsforecast/actions/workflows/build-docs.yaml/badge.svg)](https://github.com/Nixtla/statsforecast/actions/workflows/build-docs.yaml) [![Downloads](https://pepy.tech/badge/statsforecast)](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](https://nixtlaverse.nixtla.io/statsforecast/docs/getting-started/0_Installation) 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](https://nixtlaverse.nixtla.io/statsforecast/docs/getting-started/1_Getting_Started_short)** **Follow this [end-to-end walkthrough](https://nixtlaverse.nixtla.io/statsforecast/docs/getting-started/2_Getting_Started_complete) 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`, `MSTL` and `Theta` in 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: `.fit` and `.predict`. ## Highlights * Inclusion of `exogenous variables` and `prediction intervals` for ARIMA. * 20x [faster](./experiments/arima/) than `pmdarima`. * 1.5x faster than `R`. * 500x faster than `Prophet`. * 4x [faster](./experiments/ets/) than `statsmodels`. * Compiled to high performance machine code through [`numba`](https://numba.pydata.org/). * 1,000,000 series in [30 min](https://github.com/Nixtla/statsforecast/tree/main/experiments/ray) with [ray](https://github.com/ray-project/ray). * Replace FB-Prophet in two lines of code and gain speed and accuracy. Check the experiments [here](https://github.com/Nixtla/statsforecast/tree/main/experiments/arima_prophet_adapter). * Fit 10 benchmark models on **1,000,000** series in [under **5 min**](./experiments/benchmarks_at_scale/). Missing something? Please open an issue or write us in [![Slack](https://img.shields.io/badge/Slack-4A154B?&logo=slack&logoColor=white)](https://join.slack.com/t/nixtlaworkspace/shared_invite/zt-135dssye9-fWTzMpv2WBthq8NK0Yvu6A) ## Examples and Guides πŸ“š [End to End Walkthrough](https://nixtlaverse.nixtla.io/statsforecast/docs/getting-started/2_Getting_Started_complete): Model training, evaluation and selection for multiple time series πŸ”Ž [Anomaly Detection](https://nixtlaverse.nixtla.io/statsforecast/docs/tutorials/AnomalyDetection): detect anomalies for time series using in-sample prediction intervals. πŸ‘©β€πŸ”¬ [Cross Validation](https://nixtlaverse.nixtla.io/statsforecast/docs/tutorials/CrossValidation): robust model’s performance evaluation. ❄️ [Multiple Seasonalities](https://nixtlaverse.nixtla.io/statsforecast/docs/tutorials/MultipleSeasonalities): how to forecast data with multiple seasonalities using an MSTL. πŸ”Œ [Predict Demand Peaks](https://nixtlaverse.nixtla.io/statsforecast/docs/tutorials/ElectricityPeakForecasting): electricity load forecasting for detecting daily peaks and reducing electric bills. πŸ“ˆ [Intermittent Demand](https://nixtlaverse.nixtla.io/statsforecast/docs/tutorials/IntermittentData): forecast series with very few non-zero observations. 🌑️ [Exogenous Regressors](https://nixtlaverse.nixtla.io/statsforecast/docs/how-to-guides/Exogenous): 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](https://nixtlaverse.nixtla.io/statsforecast/models#class-autoarima)|βœ…|βœ…|βœ…|βœ…|βœ…| |[AutoETS](https://nixtlaverse.nixtla.io/statsforecast/models#class-autoets)|βœ…|βœ…|βœ…|βœ…|| |[AutoCES](https://nixtlaverse.nixtla.io/statsforecast/models#class-autoces)|βœ…|βœ…|βœ…|βœ…|| |[AutoTheta](https://nixtlaverse.nixtla.io/statsforecast/models#class-autotheta)|βœ…|βœ…|βœ…|βœ…|| |[AutoMFLES](https://nixtlaverse.nixtla.io/statsforecast/models#class-automfles)|βœ…|βœ…|βœ…|βœ…|βœ…| |[AutoTBATS](https://nixtlaverse.nixtla.io/statsforecast/models#class-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](https://nixtlaverse.nixtla.io/statsforecast/models#class-arima)|βœ…|βœ…|βœ…|βœ…|βœ…| |[AutoRegressive](https://nixtlaverse.nixtla.io/statsforecast/models#class-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](https://nixtlaverse.nixtla.io/statsforecast/models#class-theta)|βœ…|βœ…|βœ…|βœ…|βœ…| |[OptimizedTheta](https://nixtlaverse.nixtla.io/statsforecast/models#class-optimizedtheta)|βœ…|βœ…|βœ…|βœ…|| |[DynamicTheta](https://nixtlaverse.nixtla.io/statsforecast/models#class-dynamictheta)|βœ…|βœ…|βœ…|βœ…|| |[DynamicOptimizedTheta](https://nixtlaverse.nixtla.io/statsforecast/models#class-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](https://nixtlaverse.nixtla.io/statsforecast/models#class-mstl)|βœ…|βœ…|βœ…|βœ…|If trend forecaster supports| |[MFLES](https://nixtlaverse.nixtla.io/statsforecast/models#class-mfles)|βœ…|βœ…|βœ…|βœ…|βœ…| |[TBATS](https://nixtlaverse.nixtla.io/statsforecast/models#class-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](https://nixtlaverse.nixtla.io/statsforecast/models#class-garch)|βœ…|βœ…|βœ…|βœ…|| |[ARCH](https://nixtlaverse.nixtla.io/statsforecast/models#class-arch)|βœ…|βœ…|βœ…|βœ…|| ### Baseline Models Classical models for establishing baseline. |Model | Point Forecast | Probabilistic Forecast | Insample fitted values | Probabilistic fitted values |Exogenous features| |:------|:-------------:|:----------------------:|:---------------------:|:----------------------------:|:----------------:| |[HistoricAverage](https://nixtlaverse.nixtla.io/statsforecast/models#class-historicaverage)|βœ…|βœ…|βœ…|βœ…|| |[Naive](https://nixtlaverse.nixtla.io/statsforecast/models#class-naive)|βœ…|βœ…|βœ…|βœ…|| |[RandomWalkWithDrift](https://nixtlaverse.nixtla.io/statsforecast/models#class-randomwalkwithdrift)|βœ…|βœ…|βœ…|βœ…|| |[SeasonalNaive](https://nixtlaverse.nixtla.io/statsforecast/models#class-seasonalnaive)|βœ…|βœ…|βœ…|βœ…|| |[WindowAverage](https://nixtlaverse.nixtla.io/statsforecast/models#class-windowaverage)|βœ…||||| |[SeasonalWindowAverage](https://nixtlaverse.nixtla.io/statsforecast/models#class-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](https://nixtlaverse.nixtla.io/statsforecast/models#class-simpleexponentialsmoothing)|βœ…||βœ…||| |[SimpleExponentialSmoothingOptimized](https://nixtlaverse.nixtla.io/statsforecast/models#class-simpleexponentialsmoothingoptimized)|βœ…||βœ…||| |[SeasonalExponentialSmoothing](https://nixtlaverse.nixtla.io/statsforecast/models#class-seasonalexponentialsmoothing)|βœ…||βœ…||| |[SeasonalExponentialSmoothingOptimized](https://nixtlaverse.nixtla.io/statsforecast/models#class-seasonalexponentialsmoothingoptimized)|βœ…||βœ…||| |[Holt](https://nixtlaverse.nixtla.io/statsforecast/models#class-holt)|βœ…|βœ…|βœ…|βœ…|| |[HoltWinters](https://nixtlaverse.nixtla.io/statsforecast/models#class-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](https://nixtlaverse.nixtla.io/statsforecast/models#class-adida)|βœ…||βœ…|βœ…|| |[CrostonClassic](https://nixtlaverse.nixtla.io/statsforecast/models#class-crostonclassic)|βœ…||βœ…|βœ…|| |[CrostonOptimized](https://nixtlaverse.nixtla.io/statsforecast/models#class-crostonoptimized)|βœ…||βœ…|βœ…|| |[CrostonSBA](https://nixtlaverse.nixtla.io/statsforecast/models#class-crostonsba)|βœ…||βœ…|βœ…|| |[IMAPA](https://nixtlaverse.nixtla.io/statsforecast/models#class-imapa)|βœ…||βœ…|βœ…|| |[TSB](https://nixtlaverse.nixtla.io/statsforecast/models#class-tsb)|βœ…||βœ…|βœ…|| ## πŸ”¨ How to contribute See [CONTRIBUTING.md](https://github.com/Nixtla/statsforecast/blob/main/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](https://allcontributors.org/docs/en/emoji-key)):
azul
azul

πŸ’» 🚧
JosΓ© Morales
JosΓ© Morales

πŸ’» 🚧
Sugato Ray
Sugato Ray

πŸ’»
Jeff Tackes
Jeff Tackes

πŸ›
darinkist
darinkist

πŸ€”
Alec Helyar
Alec Helyar

πŸ’¬
Dave Hirschfeld
Dave Hirschfeld

πŸ’¬
mergenthaler
mergenthaler

πŸ’»
Kin
Kin

πŸ’»
Yasslight90
Yasslight90

πŸ€”
asinig
asinig

πŸ€”
Philip Gillißen
Philip Gillißen

πŸ’»
Sebastian Hagn
Sebastian Hagn

πŸ› πŸ“–
Han Wang
Han Wang

πŸ’»
Ben Jeffrey
Ben Jeffrey

πŸ›
Beliavsky
Beliavsky

πŸ“–
Mariana Menchero GarcΓ­a
Mariana Menchero GarcΓ­a

πŸ’»
Nikhil Gupta
Nikhil Gupta

πŸ›
JD
JD

πŸ›
josh attenberg
josh attenberg

πŸ’»
JeroenPeterBos
JeroenPeterBos

πŸ’»
Jeroen Van Der Donckt
Jeroen Van Der Donckt

πŸ’»
Roymprog
Roymprog

πŸ“–
Nelson CΓ‘rdenas BolaΓ±o
Nelson CΓ‘rdenas BolaΓ±o

πŸ“–
Kyle Schmaus
Kyle Schmaus

πŸ’»
Akmal Soliev
Akmal Soliev

πŸ’»
Nick To
Nick To

πŸ’»
Kevin Kho
Kevin Kho

πŸ’»
Yiben Huang
Yiben Huang

πŸ“–
Andrew Gross
Andrew Gross

πŸ“–
taniishkaaa
taniishkaaa

πŸ“–
Manuel Calzolari
Manuel Calzolari

πŸ’»
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!