nomogeoObserver-geometry kernel
Companion Package

Model comparison that accounts for geometry.

AIC and BIC penalise model complexity by counting parameters. But parameters are not equally informative. When predictors are correlated, the effective complexity is lower than the parameter count, and AIC/BIC choose the wrong model. nomocomp replaces the parameter count with the exact log-determinant of the observed Fisher information, correcting model rankings without approximation.

nomocomp 0.1.0 BSD-3-Clause Depends on nomogeo
The problem

AIC and BIC ignore the shape of the parameter space.

What goes wrong

Collinear predictors break the count

When two predictors carry similar information, adding both barely increases model complexity. But AIC/BIC penalise both equally. This can reverse the correct model ranking, especially when correlation is high (above 0.7) and sample size is moderate.

What nomocomp does

Geometric correction via Fisher information

nomocomp extracts the observed Fisher information matrix from each fitted model and computes the log-determinant. This is the exact fibre-volume correction: it measures the effective dimension of each model, accounting for the actual shape of the likelihood surface.

Quick start

Compare models in a few lines

import statsmodels.api as sm
from nomocomp import GeometricModelComparator

# Fit two competing models
model_a = sm.OLS(y, X_small).fit()
model_b = sm.OLS(y, X_large).fit()

# Compare with geometry
comp = GeometricModelComparator()
result = comp.compare([model_a, model_b],
                      labels=["small", "large"])

print(result.summary())
# Shows: geometric ranking, AIC ranking, BIC ranking,
# whether geometry reverses AIC/BIC, fibre volumes
What you get
  • Geometric model ranking (fibre-volume corrected).
  • AIC and BIC rankings for comparison.
  • Ranking-reversal detection: does geometry disagree?
  • Fibre volumes and branch-reversal diagnostics.
  • Pairwise information budgets between models.
Benchmark results

On collinear data, AIC gets it wrong.

High correlation

99-100% correct

At correlation 0.9 or above with n = 60+, the geometric comparator identifies the true model in 99-100% of seeds. AIC: 16%. BIC: 6%.

Phase diagram

56 cells tested

Collinearity phase diagram over 56 cells (correlation 0.0 to 0.99, sample size 20 to 200), 200 seeds each. The geometric correction reverses AIC/BIC where it matters most.

Honest boundary

Uncorrelated: no advantage

When predictors are independent, AIC and BIC already work well. The geometric correction agrees with them. It helps where they fail, not everywhere.

Install

Install from PyPI

pip install nomocomp

Requires: nomogeo >= 0.4.0, numpy, statsmodels.

Tests

22 tests, all passing

cd nomocomp && python -m pytest tests/ -q

Covers extraction, comparison, ranking reversal, and conservation diagnostics.