Skip to main content

Installation & Setup

Get AnoFox Forecast running in minutes.

System Requirements

RequirementVersion
DuckDB1.4.3 or later
OSLinux, macOS, Windows
Architecturex86_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
CREATE TABLE test_data AS
SELECT DATE '2023-01-01' + INTERVAL (i) DAY AS date,
'series_1' AS id,
100 + i AS value
FROM generate_series(0, 99) t(i);

SELECT * FROM ts_forecast_by(
'test_data', id, date, value,
'Naive', 7, '1d', 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:

FormatExampleDescription
Integer7Period in observations
Polars-style'1d', '7d', '1w', '1mo', '1q', '1y'String duration
DuckDB INTERVALINTERVAL 7 DAYNative 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:

DataIntegerString
Daily → Weekly7'1w' or '7d'
Hourly → Daily24'1d' or '24h'
Daily → Monthly30'1mo'
Daily → Yearly365'1y'
Weekly → Yearly52'52w'
Monthly → Yearly12'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 TypeMinimum Observations
Basic statistics3
Period detection4-32 (varies by method)
Forecasting2 × seasonal_period recommended
Feature extraction10+ for reliable results

Function Naming

All functions follow the pattern:

anofox_fcst_ts_<operation>[_variant]

Short aliases are available:

Full NameShort Alias
anofox_fcst_ts_forecast_byts_forecast_by
anofox_fcst_ts_detect_periods_byts_detect_periods_by
anofox_fcst_ts_fill_gaps_byts_fill_gaps_by

Case Sensitivity

  • Function names are case-insensitive
  • Column names follow DuckDB's standard rules
  • Model names (e.g., 'AutoETS') are case-sensitive
🍪 Cookie Settings