AnoFox Forecast Extension
Enterprise Time-Series Forecasting in SQL
Generate forecasts directly in DuckDB with 31 state-of-the-art modelsβno Python, no complex pipelines. Just SQL.
30-Second Exampleβ
-- Load the extension
LOAD anofox_forecast;
-- Forecast your first series
SELECT
forecast_step,
date_col,
point_forecast,
lower_95,
upper_95
FROM TS_FORECAST(
'sales_data', -- Your table
'date', -- Date column
'amount', -- Value column
'AutoETS', -- Model
28, -- Forecast horizon (days)
{'confidence_level': 0.95}
);
Output: 28 future forecasts with prediction intervals.
What's Includedβ
| Component | Coverage | Highlights |
|---|---|---|
| Forecasting Models | 31 algorithms | AutoML, Statistical, Advanced, Intermittent demand |
| Data Preparation | 12 macros | Quality checks, gap filling, transformations |
| Diagnostics | Detection + Analysis | Seasonality, changepoints, outliers |
| Evaluation | 12 metrics | MAE, RMSE, MAPE, SMAPE, MASE, and more |
| Feature Engineering | 76+ features | tsfresh-compatible statistical features |
Quick Navigationβ
π¨βπ New to Forecasting?β
Start with Understanding Forecasting to learn core concepts, then try the 5-Minute Quickstart.
π§ Getting Startedβ
- Installation & Setup β Install and load the extension
- Quickstart Tutorial β Run your first forecast
π Learn by Doingβ
Practical guides for common tasks:
- Basic Forecasting Workflow β End-to-end example
- Data Preparation β Clean and validate data
- Detecting Seasonality & Patterns β Find structure in data
- Comparing Models β Which model is best?
- Intermittent Demand β Forecasting sparse data
- Production Deployment β Scaling and optimization
π― Understand the Conceptsβ
Deep dives into forecasting fundamentals:
- Understanding Time-Series Forecasting
- Seasonality Detection & Analysis
- Choosing the Right Model
- Evaluating Forecast Accuracy
π Complete API Referenceβ
Detailed documentation for every function:
- Function Finder β Search by use case
- Forecasting Models β All 31 models documented
- Feature Engineering β Lag, rolling, Fourier features
- Diagnostics β Detection functions
- Evaluation Metrics β 12 accuracy metrics
- Utilities β Helper functions
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
- WASM-compatible: Run forecasts in the browser
π§ Comprehensive Algorithmsβ
- AutoML models for automatic parameter tuning (AutoARIMA, AutoETS, etc.)
- Statistical models proven in production (ARIMA, Exponential Smoothing, Theta)
- Advanced techniques for complex patterns (TBATS, MSTL, MFLES)
- Intermittent demand models for sparse data (Croston, ADIDA, IMAPA)
π Production-Readyβ
- Complete workflows: From raw data to deployment
- Diagnostic tools: Detect seasonality, changepoints, outliers
- Evaluation metrics: 12 ways to assess forecast quality
- Scalable: Handles millions of time series
π€ Easy Integrationβ
- Pure SQL API: No new languages or DSLs
- DuckDB native: Works with any DuckDB client
- Multi-language: Access from Python, R, Julia, JavaScript, C++, Rust
- Composable: Chain functions for complex workflows
Feature Comparisonβ
| AnoFox | Python (statsforecast) | R (forecast)
--------------------|--------|------------------------|------------------
Installation | Native | Requires Python env | Requires R env
Parallelization | Auto | Manual partitioning | Manual parallelization
Data movement | Zero | Copy to Python/Pandas | Copy to R
Speed (100K series) | Fast | Medium (Python + serial) | Medium (serial)
Models | 31 | 20+ | 15+
Intermittent demand | Yes | Limited | Limited
In-database storage | Yes | No | No
Installation & Quick Startβ
Install the Extensionβ
-- From the DuckDB community extension registry (recommended)
INSTALL anofox_forecast FROM community;
LOAD anofox_forecast;
-- Or build from source for the latest features
-- See Installation guide for details
Verify Installationβ
-- Check that the extension loaded
SELECT * FROM TS_FORECAST(
'SELECT DATE \'2023-01-01\' + INTERVAL (d) DAY AS date,
100 + RANDOM() * 10 AS value
FROM generate_series(0, 99) t(d)',
'date',
'value',
'Naive',
7,
{}
) LIMIT 5;
Next steps:
- Complete installation guide with version requirements
- 5-minute tutorial for your first real forecast
- Production deployment guide for scaling
Function Finderβ
Use this table to find the right function for your task:
| What I Want To Do | Recommended Function | Guide |
|---|---|---|
| Generate a forecast | TS_FORECAST or TS_FORECAST_BY | Basic Workflow |
| Forecast multiple series | TS_FORECAST_BY | Basic Workflow |
| Check forecast accuracy | TS_MAE, TS_RMSE, TS_MAPE | Evaluation Metrics |
| Detect seasonality | TS_DETECT_SEASONALITY | Seasonality Detection |
| Find structural breaks | TS_DETECT_CHANGEPOINTS | Pattern Detection |
| Clean data | TS_FILL_GAPS, TS_REMOVE_OUTLIERS | Data Preparation |
| Extract features | TS_TSFRESH_FEATURES | Feature Engineering |
| Forecast sparse data | TS_CROSTON, TS_ADIDA | Intermittent Demand |
| Try many models | TS_FORECAST_ENSEMBLE | Model Comparison |
| Get data quality report | TS_QUALITY_REPORT | Data Preparation |
Key Concepts at a Glanceβ
Time Seriesβ
A sequence of values measured over time. Examples: daily sales, hourly temperature, monthly revenue.
Forecast Horizonβ
How many time steps ahead to predict. "Forecast 30 days ahead" = horizon of 30.
Seasonalityβ
Repeating patterns in data. E.g., retail sales spike before Christmas, electricity demand peaks in summer.
Trendβ
Long-term direction. E.g., "sales have been increasing for the last year."
Prediction Intervalβ
Range of uncertainty around a forecast. E.g., "95% confident the value will be between 100 and 120."
Performance Characteristicsβ
Tested on standard hardware (Dell XPS 13, 8-core CPU):
| Task | Data Size | Time | Notes |
|---|---|---|---|
| Single series ARIMA | 2 years daily | <1s | Monthly M5 dataset |
| 10,000 series Theta | 30k points total | <5s | Parallel on 8 cores |
| 100,000 series Naive | 100k points total | <1s | Baseline model |
| Feature extraction | 1M points | ~30s | 76 statistical features |
See Production Deployment for optimization strategies.
What's Newβ
- 31 forecasting models: Full model coverage across all categories
- Automatic model selection: AutoML for ARIMA, ETS, MFLES, TBATS, Theta
- Multiple seasonality: MSTL for complex seasonal patterns
- Feature engineering: 76+ tsfresh-compatible features
- Changepoint detection: Bayesian Online Changepoint Detection (BOCPD)
- Production-ready: Monitoring, logging, deployment guides
Support & Communityβ
- Issues & Bugs: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Browse guides and API reference on this site
Licenseβ
Licensed under the Business Source License 1.1 (BSL-1.1). See LICENSE for details.
Key points:
- Free for development, testing, and academic research
- Converts to Apache License 2.0 on January 1, 2027
- See full license terms for commercial use
Next Stepsβ
- First time here? β Installation Guide
- Want to forecast? β 5-Minute Quickstart
- New to time-series? β Understanding Forecasting
- Building an application? β Production Deployment
- Need a specific function? β API Reference