Anofox Forecast
AnoFox Forecast provides 32 production-grade forecasting models -- including AutoETS, AutoARIMA, TBATS, MFLES, and 6 intermittent demand methods -- all accessible through standard SQL. Each model runs natively inside DuckDB as a C++ extension with zero-copy columnar processing, eliminating the overhead of Python-based forecasting pipelines. A single ts_forecast_by call generates forecasts for thousands of time series in parallel, with built-in prediction intervals and 11 accuracy metrics for validation.
What is Anofox Forecast?
Time-series forecasting is the practice of using historical observations ordered in time to predict future values. Anofox Forecast brings enterprise time-series forecasting directly to DuckDB, generating forecasts with 32 state-of-the-art models using pure SQL - no Python, no complex pipelines, zero data movement.
Key Features
- 32+ Forecasting Models - AutoML, Statistical, Advanced, Intermittent, and Exogenous variants (ARIMAX, ThetaX, MFLESX)
- Pattern Detection - 12 period detection methods, seasonality classification, changepoint analysis
- Feature Engineering - 117 tsfresh-compatible statistical features
- Cross-Validation - 8 functions for backtesting and CV splits with data leakage prevention
- Conformal Prediction - Distribution-free prediction intervals with guaranteed coverage
- Evaluation Metrics - 11 accuracy metrics including MAE, RMSE, MAPE, MASE
- Production Ready - Handles millions of series with automatic parallelization
Quick Links
| Documentation | Description |
|---|---|
| Installation | Setup and prerequisites |
| Function Finder | Find the right function for your task |
| Exploratory Data Analysis | Profile your time series data |
| Data Quality | Multi-dimensional quality assessment |
| Data Preparation | Clean and transform your data |
| Diagnostics | Pattern detection and analysis |
| Features | Feature engineering functions |
| Models | All 32+ forecasting models |
| Metrics | 12 evaluation metrics |
| Cross-Validation | Backtesting and CV splits |
| Conformal Prediction | Distribution-free prediction intervals |
| Exogenous Variables | External predictors (ARIMAX, ThetaX, MFLESX) |
| Hierarchy Management | Multi-level key handling |
Basic Usage
-- Load the extension
LOAD anofox_forecast;
-- Forecast your first series
SELECT *
FROM ts_forecast_by(
'sales_data', -- Your table
product_id, -- Group column
date, -- Date column
amount, -- Value column
'AutoETS', -- Model
28, -- Forecast horizon (days)
'1d', -- Frequency
MAP{'seasonal_period': '7'}
);
This returns 28 future forecasts with prediction intervals per series - all computed in-database.
Why Anofox Forecast?
- Native Performance - Zero Python overhead, direct C++ execution in DuckDB
- Automatic Parallelization - DuckDB distributes work across CPU cores
- In-Database - Process petabyte-scale data without moving it
- Pure SQL API - No new languages or DSLs to learn
The extension covers the entire forecasting lifecycle in 8 functional categories: exploratory data analysis with 36-column statistical profiles, 14 data preparation functions for gap filling and imputation, 12 period detection algorithms for seasonality discovery, 117 tsfresh-compatible feature extraction functions, 8 cross-validation functions with data leakage prevention, and 11 conformal prediction functions for distribution-free prediction intervals. Every function operates directly on DuckDB tables with automatic parallelization across CPU cores.
Frequently Asked Questions
Which model should I start with?
Start with AutoETS. It automatically selects the best error, trend, and seasonal components using information criteria and handles most common forecasting scenarios. If you have multiple seasonal patterns (e.g., daily + weekly), try AutoMFLES or AutoTBATS. For data with many zeros, use an intermittent demand model like CrostonSBA.
Does AnoFox Forecast auto-detect seasonality?
Most models do not auto-detect the seasonal period. You should first run ts_detect_periods_by with one of 12 detection algorithms (FFT, ACF, autoperiod, etc.) and then pass the detected period explicitly via the seasonal_period parameter. This two-step approach gives you full control and avoids silent misdetection.
How do I incorporate external variables like temperature or promotions?
Use the exogenous model variants: ARIMAX, ThetaX, or MFLESX. Call ts_forecast_exog_by instead of ts_forecast_by, passing your historical and future exogenous values. You must provide future values for all external predictors covering the entire forecast horizon. See the Exogenous Variables page for full examples.
How much historical data do I need?
As a rule of thumb, you need at least 2x the seasonal period in observations. For weekly seasonality (period=7), that means at least 14 daily observations. For yearly seasonality (period=365), you need at least 2 years. More data generally improves accuracy, but diminishing returns set in after 3-5 seasonal cycles for most models.