StatsForecast
StatsForecast is an open-source Python library developed by Nixtla Inc.
Publisher review
StatsForecast is an open-source Python library developed by Nixtla Inc. for large-scale time series forecasting. It is designed for data scientists and engineers who need to fit and predict millions of time series quickly and accurately in production environments. The library provides fast, numba-optimized implementations of classic statistical models including AutoARIMA, AutoETS, AutoCES, MSTL, and Theta, and claims to be 20x faster than pmdarima for ARIMA, 500x faster than Prophet, and 4x faster than statsmodels for ETS. It can fit 10 benchmark models on 1,000,000 series in under 5 minutes using parallel backends like Ray, Dask, and Spark. StatsForecast also supports probabilistic forecasting with confidence intervals, exogenous variables, static covariates, and anomaly detection, all accessible through a familiar sklearn-like .fit() and .predict() API.
The core workflow centers on the StatsForecast class, which accepts a list of models and a DataFrame with columns for unique_id, ds (timestamp), and y (value). After calling .fit(), users generate forecasts with .predict(h=horizon, level=[confidence_levels]). For example, AutoARIMA with season_length=12 on monthly data can be fit and predicted in three lines of code. The library includes automatic model selection (AutoARIMA, AutoETS, AutoCES, AutoTheta) and specialized models like MSTL for multiple seasonalities and AutoTBATS for complex seasonal patterns. All automatic models output both point forecasts and probabilistic forecasts with fitted values. Exogenous regressors are supported for AutoARIMA and AutoMFLES, and the library can detect anomalies by comparing in-sample prediction intervals against actual values.
StatsForecast competes directly with Prophet, Darts, and sktime, positioning itself as a faster drop-in replacement for Prophet (500x speedup claimed) and a more scalable alternative to pmdarima and statsmodels. Its benchmarks show it can handle 1,000,000 series in 30 minutes with Ray, and it is 1.5x faster than R's forecast package for ARIMA. While Darts and sktime offer broader model ecosystems (including deep learning), StatsForecast focuses exclusively on statistical models optimized for speed and scale. The library is part of the Nixtlaverse ecosystem, which includes tools like utilsforecast for plotting and evaluation. Its primary advantage is raw performance on large collections of univariate time series, making it suitable for production forecasting pipelines where speed and accuracy are critical.
However, StatsForecast has notable trade-offs. Its documentation and examples are less extensive than those of more established libraries like Prophet or statsmodels, which can make troubleshooting harder for new users. Some advanced features—such as distributed computing with Ray, Dask, or Spark—require additional setup and dependencies beyond a simple pip install. The library is narrowly focused on statistical models; it does not include deep learning or gradient boosting models like those in Darts or sktime. Additionally, while the core library is free and open-source under an Apache 2.0 license, commercial use of the broader Nixtla platform may require contacting the company for a tailored quote, which could be a barrier for enterprise teams needing support or advanced features.
How it works
-
AutoARIMA
Automatically selects the best ARIMA model parameters using a numba-optimized algorithm that is 20x faster than pmdarima and 1.5x faster than R.
-
AutoETS
Automatically selects exponential smoothing model parameters, achieving 4x faster performance than statsmodels' implementation.
-
Probabilistic Forecasting
Generates prediction intervals and confidence levels for all automatic models, enabling uncertainty quantification in forecasts.
-
Parallel Backends
Supports out-of-the-box distribution with Spark, Dask, and Ray, allowing fitting of 1,000,000 series in 30 minutes using Ray.
-
Anomaly Detection
Detects anomalies by comparing in-sample prediction intervals against actual values, useful for monitoring time series data.
-
Exogenous Variables
Supports static covariates and exogenous regressors for AutoARIMA and AutoMFLES, enabling inclusion of external factors like weather or prices.
-
sklearn-like API
Uses familiar .fit() and .predict() methods, making it easy for users of scikit-learn to adopt without learning new syntax.
Strengths and trade-offs
Strengths
- AutoARIMA is 20x faster than pmdarima and 500x faster than Prophet, as benchmarked on M4 hourly data.
- Can fit 10 benchmark models on 1,000,000 time series in under 5 minutes using Ray parallel processing.
- Provides probabilistic forecasts with confidence intervals for all automatic models, including AutoARIMA, AutoETS, and AutoCES.
- Offers a drop-in replacement for Prophet that requires only two lines of code change and delivers significant speed and accuracy improvements.
Trade-offs
- Documentation and examples are less extensive than those of more established libraries like Prophet or statsmodels, which can hinder onboarding.
- Advanced features such as distributed computing with Ray, Dask, or Spark require additional setup and dependencies beyond the base installation.
- The library is limited to statistical models and does not include deep learning or gradient boosting models available in Darts or sktime.
- Commercial use of the broader Nixtla platform may require contacting the company for a tailored quote, creating uncertainty for enterprise teams.
Pricing context
Free and open-source under an Apache 2.0 license. Commercial use of the broader Nixtla platform requires contacting Nixtla Inc. for a tailored quote.
Getting started with StatsForecast
-
Install StatsForecast
Run `pip install statsforecast` in your terminal. For distributed backends like Ray, Dask, or Spark, install extras such as `pip install statsforecast[ray]`.
-
Prepare your DataFrame
Create a pandas DataFrame with columns named `unique_id`, `ds` (timestamp), and `y` (value). Each row represents one observation for a time series.
-
Initialize the model
Import StatsForecast from statsforecast. Instantiate it with a list of models, e.g., `[AutoARIMA(season_length=12)]`, and pass your DataFrame.
-
Fit and forecast
Call `.fit()` on the StatsForecast object, then `.predict(h=horizon, level=[80, 95])` to generate point forecasts and prediction intervals.
-
Scale with parallel backends
To handle millions of series, set `n_jobs=-1` or use a Ray cluster. Pass `engine='ray'` to the StatsForecast constructor and ensure Ray is installed.
Frequently Asked Questions
What is StatsForecast and what does it do?
StatsForecast is an open-source Python library from Nixtla Inc. for large-scale time series forecasting. It provides fast, numba-optimized implementations of classic statistical models like AutoARIMA and AutoETS, designed to fit and predict millions of series quickly in production environments.
How much faster is StatsForecast compared to Prophet and pmdarima?
StatsForecast claims to be 500x faster than Prophet and 20x faster than pmdarima for ARIMA, based on benchmarks on M4 hourly data. It also achieves 4x faster performance than statsmodels for ETS and 1.5x faster than R's forecast package for ARIMA.
What models and features does StatsForecast include?
StatsForecast includes AutoARIMA, AutoETS, AutoCES, MSTL, and Theta. It supports probabilistic forecasting with confidence intervals, exogenous variables, static covariates, anomaly detection, and automatic model selection. All models use a familiar sklearn-like .fit() and .predict() API.
Can StatsForecast handle millions of time series at once?
Yes, StatsForecast can fit 10 benchmark models on 1,000,000 time series in under 5 minutes using parallel backends like Ray, Dask, and Spark. With Ray, it can handle 1,000,000 series in about 30 minutes, making it suitable for large-scale production pipelines.
What are the main limitations of StatsForecast?
StatsForecast has less extensive documentation than Prophet or statsmodels, which can make troubleshooting harder. Advanced features like distributed computing require extra setup. It focuses only on statistical models, excluding deep learning or gradient boosting. Commercial use of the Nixtla platform may need a tailored quote.
Is StatsForecast free to use for commercial purposes?
The core StatsForecast library is free and open-source under an Apache 2.0 license. However, commercial use of the broader Nixtla platform may require contacting Nixtla Inc. for a tailored quote, which could create uncertainty for enterprise teams needing support or advanced features.
Alternatives
How StatsForecast compares
Direct head-to-head against 2 competitors. Picked by 7wData.
StatsForecast
- Pricing
- Free and open-source under an Apache 2.0 license. Commercial use of the broader Nixtla platform requires contacting Nixtla Inc. for a tailored quote.
- Target
- StatsForecast is an open-source Python library developed by Nixtla Inc.
- Strength
- AutoARIMA is 20x faster than pmdarima and 500x faster than Prophet, as benchmarked on M4 hourly data.
- Watch for
- Documentation and examples are less extensive than those of more established libraries like Prophet or statsmodels, which can hinder onboarding.
Prophet
- Pricing
- Free (open-source)
- Target
- Time series forecasting with strong seasonality and holiday effects
- Deployment
- Python/R library
- Strength
- Handles multiple seasonalities and holiday effects automatically
- Watch for
- Slower on large datasets; limited to daily or sub-daily data
Amazon Forecast
- Pricing
- Pay-per-use (training + inference)
- Target
- Fully managed forecasting for AWS users
- Deployment
- AWS managed service
- Strength
- AutoML with DeepAR+ and CNN-QR for complex patterns
- Watch for
- Vendor lock-in; 4.1 hours for M5 dataset vs minutes with StatsForecast
User reviews
No user reviews yet. Be the first to write one.
Sources
Reporting on this tool draws on these publicly available sources.