Skip to main content

Nixtla   Tweet  Slack

All Contributors

Statistical ⚡️ Forecast

Lightning fast forecasting with statistical and econometric models

CI Python PyPi conda-nixtla License: MIT docs

StatsForecast offers a collection of widely used univariate time series forecasting models, including automatic ARIMA and ETS modeling optimized for high performance using numba. It also includes a large battery of benchmarking models.

💻 Installation and Getting Started

PyPI

You can install the released version of StatsForecast from the Python package index with:

pip install statsforecast

(Installing inside a python virtualenvironment or a conda environment is recommended.)

Conda

Also you can install the released version of StatsForecast from conda with:

conda install -c conda-forge statsforecast

(Installing inside a python virtualenvironment or a conda environment is recommended.)

Dev Mode If you want to make some modifications to the code and see the effects in real time (without reinstalling), follow the steps below:
git clone https://github.com/Nixtla/statsforecast.git
cd statsforecast
pip install -e .

To get started just follow this guide.

🎉 New!

  • Open In Colab ETS Example: 4x faster than StatsModels with improved accuracy and robustness.
  • Open In Colab Complete pipeline and comparison: 20x faster than pmdarima and 500x faster than Prophet.

🔥 Highlights

  • Fastest and most accurate auto_arima in Python and R.

  • Fastest and most accurate ets in Python and R.

  • New!: Replace FB-Prophet in two lines of code and gain speed and accuracy. Check the experiments here.

  • New!: Distributed computation in clusters with ray. (Forecast 1M series in 30min)

  • New!: Good Ol' sklearn syntax with AutoARIMA().fit(y).predict(h=7).

🎊 Features

  • Inclusion of exogenous variables and prediction intervals for 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.

  • Out of the box implementation of ses, adida, historic_average, croston_classic, croston_sba, croston_optimized, seasonal_window_average, seasonal_naive, imapa naive, random_walk_with_drift, window_average, seasonal_exponential_smoothing, tsb, auto_arima and ets.

Missing something? Please open an issue or write us in Slack

📖 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.

🔬 Accuracy & ⏲ Speed

ARIMA

The auto_arima model implemented in StatsForecast is 20x faster than pmdarima and 1.5x faster than R while improving accuracy. You can see the exact comparison and reproduce the results here.

ETS

StatsForecast's exponential smoothing is 4x faster than StatsModels' and 1.6x faster than R's, with improved accuracy and robustness. You can see the exact comparison and reproduce the resultshere

Benchmarks at Scale

With StatsForecast you can fit 9 benchmark models on 1,000,000 series in under 5 min. Reproduce the results here.

🧬 Getting Started

You can run this notebooks to get you started.

  • Example of different auto_arima models on M4 data Open In Colab

    • In this notebook we present Nixtla's auto_arima. The auto_arima model is widely used to forecast time series in production and as a benchmark. However, the alternative python implementation (pmdarima) is so slow that prevents data scientists from quickly iterating and deploying auto_arima in production for a large number of time series.
  • Shorter Example of fitting and auto_arima and an ets model. Open In Colab

  • Benchmarking 9 models on millions of series.

📖 Documentation (WIP)

Here is a link to the documentation.

🔨 How to contribute

See CONTRIBUTING.md.

📃 References

  • The auto_arima model is based (translated) from the R implementation included in the forecast package developed by Rob Hyndman.
  • The ets model is based (translated) from the R implementation included in the forecast package developed by Rob Hyndman.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


fede

💻

José Morales

💻 🚧

Sugato Ray

💻

Jeff Tackes

🐛

darinkist

🤔

Alec Helyar

💬

Dave Hirschfeld

💬

mergenthaler

💻

Kin

💻

Yasslight90

🤔

asinig

🤔

Philip Gillißen

💻

Sebastian Hagn

🐛

This project follows the all-contributors specification. Contributions of any kind welcome!

Metadata

Release files for statsforecast 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for statsforecast 0.7.0
File Size Uploaded Provenance Actions
statsforecast-0.7.0.tar.gz 48.8 kB Without provenance Details for statsforecast-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for statsforecast 0.7.0
File Interpreter ABI Platform Actions
statsforecast-0.7.0-py3-none-any.whl Python 3 none any Details for statsforecast-0.7.0-py3-none-any.whl

Total release size: 94.3 kB

Release files / statsforecast-0.7.0.tar.gz

Download URL statsforecast-0.7.0.tar.gz
Size 48.8 kB
Tags Source
SHA-256 checksum
How to use checksums
eb20745e4459330bc59f738722e5363c06dddaabd2ba54564e4a28e45c36176c
BLAKE2b-256 checksum
How to use checksums
bd9df5e0c760f5bb663118ae268892df891385981e48e1dad397153e40b1ef38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / statsforecast-0.7.0-py3-none-any.whl

Download URL statsforecast-0.7.0-py3-none-any.whl
Size 45.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9bf716e2a3c6abc67aa38d23c9f2661ec02cca762a177fe46b10703a31c8a9a1
BLAKE2b-256 checksum
How to use checksums
88b28c36335d20e487a8423c06d82609c8d3b754e4283601c3afa0a1b3221d32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for statsforecast 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page