Statsforecast
Lightning ⚡️ fast forecasting with statistical and econometric models.
Install / Use
/learn @Nixtla/StatsforecastREADME
Nixtla
<div align="center"> <img src="https://raw.githubusercontent.com/Nixtla/neuralforecast/main/nbs/imgs_indx/logo_mid.png"/> <h1 align="center">Statistical ⚡️ Forecast</h1> <h3 align="center">Lightning fast forecasting with statistical and econometric models</h3>StatsForecast offers a collection of widely used univariate time series forecasting models, including automatic ARIMA, ETS, CES, and Theta modeling optimized for high performance. It also includes a large battery of benchmarking models.
Installation
You can install StatsForecast with:
pip install statsforecast
or
conda install -c conda-forge statsforecast
Vist our Installation Guide for further instructions.
Quick Start
Minimal Example
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. - 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](https://nixtlaverse.nixtla.io/statsforecast/src/core/models.htm
Related Skills
claude-opus-4-5-migration
82.7kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
model-usage
335.8kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
feishu-drive
335.8k|
things-mac
335.8kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
