Installation & Setup
Get AnoFox Forecast running in minutes.
System Requirements
| Requirement | Version |
|---|---|
| DuckDB | 1.4.3 or later |
| OS | Linux, macOS, Windows |
| Architecture | x86_64, ARM64, WASM |
Installation
Install from the DuckDB Community Registry:
INSTALL anofox_forecast FROM community;
LOAD anofox_forecast;
For local builds or development versions, see the GitHub repository.
Verify Installation
-- Load extension
LOAD anofox_forecast;
-- Test with a simple forecast
SELECT * FROM anofox_fcst_ts_forecast(
'SELECT DATE ''2023-01-01'' + INTERVAL (i) DAY AS date,
100 + i AS value
FROM generate_series(0, 99) t(i)',
'date',
'value',
'Naive',
7,
MAP{}
)
LIMIT 3;
Persistent Loading
To load the extension automatically, create a .duckdbrc file:
# ~/.duckdbrc
LOAD anofox_forecast;
Frequency Format
Many functions require a frequency parameter. Three formats are supported:
| Format | Example | Description |
|---|---|---|
| Integer | 7 | Period in observations |
| Polars-style | '1d', '7d', '1w', '1mo', '1q', '1y' | String duration |
| DuckDB INTERVAL | INTERVAL 7 DAY | Native DuckDB interval |
Examples:
-- All equivalent for weekly data
SELECT * FROM ts_fill_gaps('data', 'id', 'date', 'value', 7);
SELECT * FROM ts_fill_gaps('data', 'id', 'date', 'value', '1w');
SELECT * FROM ts_fill_gaps('data', 'id', 'date', 'value', '7d');
Common Frequencies:
| Data | Integer | String |
|---|---|---|
| Daily → Weekly | 7 | '1w' or '7d' |
| Hourly → Daily | 24 | '1d' or '24h' |
| Daily → Monthly | 30 | '1mo' |
| Daily → Yearly | 365 | '1y' |
| Weekly → Yearly | 52 | '52w' |
| Monthly → Yearly | 12 | '12mo' |
Key Design Principles
NULL Handling
- Most functions ignore NULL values in calculations
- NULLs in arrays are skipped, not replaced
- Use
ts_fill_nulls_*functions to handle NULLs before forecasting
Minimum Requirements
| Function Type | Minimum Observations |
|---|---|
| Basic statistics | 3 |
| Period detection | 4-32 (varies by method) |
| Forecasting | 2 × seasonal_period recommended |
| Feature extraction | 10+ for reliable results |
Function Naming
All functions follow the pattern:
anofox_fcst_ts_<operation>[_variant]
Short aliases are available:
| Full Name | Short Alias |
|---|---|
anofox_fcst_ts_forecast | ts_forecast |
anofox_fcst_ts_detect_seasonality | ts_detect_seasonality |
anofox_fcst_ts_fill_gaps | ts_fill_gaps |
Case Sensitivity
- Function names are case-insensitive
- Column names follow DuckDB's standard rules
- Model names (e.g.,
'AutoETS') are case-sensitive