nomocomp
Exact geometric model comparison via fibre-volume correction.
Documentation: docs.nomogenetics.com/nomocomp
Version: 0.1.0
Requires: nomogeo >= 0.4.0, numpy, statsmodels
What it does
nomocomp replaces AIC/BIC parameter-count penalties with the actual log-determinant of the observed Fisher information — the exact fibre-volume correction in the Gaussian-fibre sector.
For nested Gaussian linear models:
- AIC uses
-2 log L + 2k - BIC uses
-2 log L + k log(n) - nomocomp uses
-2 log L + log det(I) - k log(2pi)
The third formula accounts for how tightly concentrated the posterior is in each parameter direction, not just how many parameters there are.
Install
pip install nomocomp
Flagship result
In nested Gaussian families with collinear predictors, the omitted determinant correction reverses both AIC and BIC rankings. A 56-cell collinearity phase diagram over 200 seeds shows the reversal activating continuously as correlation increases.
- At rho >= 0.9, n >= 60: exact Laplace evidence identifies the true model in 99-100% of seeds
- AIC identifies it in ~16%; BIC in ~6%
- The determinant correction is +1.5 to +3.9 nats depending on collinearity
When predictors are independent, AIC and BIC already work well and nomocomp agrees with them. The advantage appears where they fail.
Quick start
from nomocomp.extraction import extract_information
from nomocomp.comparator import GeometricModelComparator
# Extract Fisher information from fitted models
score = extract_information(ols_result, label="M1")
# Compare models with geometry
comp = GeometricModelComparator()
result = comp.compare({"M1": fit1, "M2": fit2})
print(result.geometric_ranking)
print(result.ranking_reversals)
Modules
nomocomp.extraction
Extracts the observed Fisher information matrix from fitted statsmodels results.
score = extract_information(ols_result, label="M1")
# score.geometric_score — exact Laplace score (lower = better)
# score.information_matrix — observed Fisher information at MLE
# score.log_det_information — log det(I)
# score.aic, score.bic — standard criteria for comparison
nomocomp.comparator
Compares multiple fitted models and detects ranking reversals.
result = comp.compare({"M1": fit1, "M2": fit2})
# result.geometric_ranking — models ranked by exact score
# result.ranking_reversals — where geometric disagrees with AIC/BIC
# result.branch_reversal — nomogeo branch-reversal detection
Honest boundaries
- Exact in the Gaussian-fibre sector. For non-Gaussian likelihoods, the information matrix captures local curvature only — still sharper than a parameter count, but not the exact fibre volume.
- Flat improper prior on all parameters. For nested models the prior on shared parameters cancels.
- "Exact local Laplace" means exact to quadratic order at the MLE. Not the exact marginal likelihood.
- Not yet a state-space comparator. The state-space comparison pipeline is not yet built.
Verification
python -m pytest tests/ -q # 22 tests
License
BSD-3-Clause. See LICENSE.
Metadata
Release files for nomocomp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nomocomp-0.1.0.tar.gz | 14.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nomocomp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.3 kB
Release files / nomocomp-0.1.0.tar.gz
| Download URL | nomocomp-0.1.0.tar.gz |
|---|---|
| Size | 14.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2ed060ebe7c2e6cda4f6b2c52394cd6f5c07915c65dcd7ee67cf77aa1157843b
|
|
BLAKE2b-256 checksum How to use checksums |
ef3c954106df7a66043c1d6a132a3a8b409b4e12ae6fdc7007cf841e76bcf0ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Release files / nomocomp-0.1.0-py3-none-any.whl
| Download URL | nomocomp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
669fb277ff8e489b087b59cd5b0617f7b7b3311e27c65bfdadc59076061157f9
|
|
BLAKE2b-256 checksum How to use checksums |
923eca5dba953e008f29d1b95a02451154959c0edde9424d4ed7daf6925fb3b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|