Anofox Statistics
What is Anofox Statistics?
Anofox Statistics brings professional-grade statistical analysis directly to DuckDB. Build predictive models, run hypothesis tests, and validate assumptions using pure SQL - no Python overhead, no data export/import cycles.
Key Features
- Regression Analysis - OLS, Ridge, WLS, RLS, Elastic Net with full inference
- Hypothesis Testing - 30+ tests including t-test, ANOVA, chi-square, correlation
- Model Diagnostics - VIF, residual analysis, normality tests, information criteria
- Specialized Models - Poisson GLM, ALM (24 distributions), constrained optimization
- Aggregates & Windows - GROUP BY and OVER patterns for rolling/expanding analysis
Quick Links
| Documentation | Description |
|---|---|
| Installation | Setup and prerequisites |
| Function Finder | Find the right function for your task |
| Regression | OLS, Ridge, WLS, RLS, Elastic Net, GLM, ALM, BLS, NNLS |
| Demand Analysis | AID classification and anomaly detection |
| Hypothesis Tests | Parametric, nonparametric, correlation |
| Diagnostics | VIF, residuals, normality, model selection |
| DuckDB Patterns | Aggregates, windows, helpers |
Basic Usage
-- Load the extension
LOAD anofox_statistics;
-- Fit a linear regression model
SELECT
(model).coefficients,
(model).r_squared,
(model).p_values
FROM (
SELECT anofox_stats_ols_fit_agg(
revenue,
[marketing_spend, team_size]
) as model
FROM sales_data
);
This returns coefficients with statistical significance tests, goodness-of-fit metrics, and standard errors - all computed in-database.