# 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
[](https://twitter.com/intent/tweet?text=Statistical%20Forecasting%20Algorithms%20by%20Nixtla%20&url=https://github.com/Nixtla/statsforecast&via=nixtlainc&hashtags=StatisticalModels,TimeSeries,Forecasting)
[](https://join.slack.com/t/nixtlacommunity/shared_invite/zt-1pmhan9j5-F54XR20edHk0UtYAPcW4KQ)
[](#contributors-)
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](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 [](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)):
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!