Anofox Forecast
Time Series Forecasting for DuckDB
Technical Depth: A (93%) | Code Health: A- (90%) - calculated using PMAT
A time series forecasting extension for DuckDB with 36 models, statistical diagnostics, data preparation, and analytics — all in pure SQL.
🤖 Built for AI pair-programming. anofox-forecast ships an installable Claude Code plugin — five skills that give your AI assistant verified, hallucination-free knowledge of the full SQL API. Describe the forecast in plain English; Claude writes correct ts_forecast_by, ensemble, backtest, and diagnostics queries.
Install with /plugin marketplace add DataZooDE/anofox-forecast → /plugin install anofox-forecast@anofox-forecast.
✨ Key Features
🎯 Forecasting (36 Models)
- AutoML: AutoETS, AutoARIMA, AutoTBATS, plus the deprecated-but-accepted aliases AutoMFLES/AutoMSTL (same code path as MFLES/MSTL, reported
model_name matches the bare family name)
- Statistical: ETS, ARIMA, Theta, Holt-Winters, Seasonal Naive
- Advanced: TBATS, MSTL, MFLES (multiple seasonality)
- Intermittent Demand: Croston, ADIDA, IMAPA, TSB
- Distributional: Laplace (streaming likelihood-weighted mixture, three zero-config selectors:
auto / auto_aid / skaters)
- Volatility & State-Space: GARCH (conditional volatility), Kalman filter (local-level / local-linear-trend)
- Global / Panel: GlobalETS, GlobalTheta, GlobalCroston — cross-series "fit once, forecast all" via
ts_forecast_panel_by
- Multivariate: VAR (vector autoregression) via
ts_forecast_var_by — N value columns → per-variable forecasts
- Exogenous Variables: crate-native exog support for Naive, ARIMA, AutoARIMA, the Theta family, ETS/AutoETS, MFLES, and MSTL — reported
model_name is the base model's own name with " with regressors" appended (no separate model name)
🔬 Statistical Diagnostics
- Stationarity: ADF, KPSS, and a combined four-way verdict, each with
regression := 'c' (default) or 'ct' for trend-stationarity (ts_adf_by, ts_kpss_by, ts_stationarity_by)
- Residual Adequacy: Ljung-Box (model-aware via
fitted_params := p + q, R Box.test(fitdf)-exact), Durbin-Watson, Jarque-Bera, plus a combined pass/fail report (ts_residual_diagnostics_by)
- Reference-checked: Ljung-Box, Jarque-Bera, Durbin-Watson, and the KPSS statistic are numerically cross-checked against R (
stats::Box.test, tseries) and scipy; ADF/KPSS p-values are a coarse approximation, not cross-validated (see docs/api/10-diagnostics.md)
📊 Complete Workflow
- EDA & Data Quality: 5 functions (2 table functions, 3 macros) for exploratory analysis and data quality assessment
- Data Preparation: 12 macros for cleaning and transformation
- Multi-Key Hierarchy: 4 functions for combining, aggregating, and splitting hierarchical time series (region/store/item)
- Cross-Validation & Backtesting: Time series CV with expanding/fixed/sliding windows, gap, embargo, and variable horizon support
- Conformal Prediction: Distribution-free prediction intervals, horizon-ordered and calibrated per group, plus residual-resampling bootstrap intervals (see
docs/api/11-conformal-prediction.md)
- Evaluation: 12 metrics including coverage analysis
- Seasonality Detection: Automatic period identification, seasonality classification, and peak detection
- Changepoint Detection: Regime identification with probabilities