Skip to content

dit's discrete entropy estimators: options, benchmarks, and Chao-Wang-Jost as the default layer estimator - #12

Merged
Autoplectic merged 5 commits into
mainfrom
dit-estimators
Nov 1, 2026
Merged

Autoplectic merged 5 commits into
mainfrom
dit-estimators

Conversation

@Autoplectic

Copy link
Copy Markdown
Member

Brings dit's new discrete entropy estimators (dit PRs #295 and #305) into infoflow, benchmarks them against the old defaults, and adopts the one change that held up: Chao-Wang-Jost for the flow layers. Full results are in reports/dit_estimators.md.

Changes

  • Any dit entropy estimator for the layers: infer_multiplex(estimator=...), estimate_edge, layer_statistics and crossfit_flows accept any of dit.inference.estimators.ENTROPY_ESTIMATORS. Intrinsic flow is evaluated at the hardened channel, because these estimators need integer counts (measures.evaluation_table).
  • Any dit entropy estimator for selection: SkeletonSettings(entropy_estimator=...) swaps the entropies in the plug-in selection statistic. The permutation tests stay valid for any statistic.
  • New default: measures.DEFAULT_LAYER_ESTIMATOR = "chao_wang_jost", replacing Miller-Madow. It's used by the functions above, the channel layer and auto's cost pilot. The selection statistic stays plug-in, and compare_networks keeps Miller-Madow. Pass estimator="miller_madow" to reproduce old results.
  • Single-outcome guard: single-outcome entropy terms return 0 for dit estimators (PYM raises on them).
  • dit lock: moved to 6314d14e. dit #306 renamed prng to rng, and total_correlation_ksg rejects the old name despite the deprecation alias, so infoflow now passes rng.
  • Validation scripts:
    • validation/dit_estimators.py: layer accuracy on sofic processes with exact flows.
    • validation/dit_estimators_selection.py: selection on random networks with known graphs.
    • validation/dit_estimators_catfr.py: a bias probe and a selection check on catFR1 iEEG.
    • validation/new_defaults.py: configurations compared on VAR, logistic-map and Lorenz-96 networks, the motifs, NetSim and CausalRivers, with optional copula normalisation.

Findings

  • Layers. Chao-Wang-Jost lowered the cross-fitted layer RMSE against Miller-Madow from 0.047 to 0.035 bits at 300 samples and from 0.019 to 0.014 at 1,000 (0.007 for both at 3,000). Most of the gain is in synergistic bias. On catFR with the source shuffled (every true layer zero), the spurious synergy per edge dropped from 0.0010 to 0.0004 bits.
  • Default switch on whole networks.
    • Intrinsic-layer recall rose on every synthetic type, at unchanged precision: VAR 0.29 → 0.39, logistic maps 0.35 → 0.54, Lorenz-96 0.04 → 0.33.
    • NetSim and CausalRivers were unchanged.
    • Networks took about 1.5× as long.
  • Calibration. On 40 pairs of independent AR(1) processes, false layers with Chao-Wang-Jost were 3 intrinsic, 5 synergistic and 5 shared, against 1, 5 and 13 with Miller-Madow. The uncoupled test now counts runs with any false flow (at most 1 of 8), because on one seed Chao-Wang-Jost flags both layers of the edge Miller-Madow flags once.
  • Selection: not adopted.
    • Miller-Madow raised recall by 0.05 on VAR and logistic networks at no cost, but cost CausalRivers 0.06 AUROC. A decomposition run confirmed the selection change was the whole cause.
    • Chao-Wang-Jost, Wu-Yang and Panzeri-Treves raised recall more, but worsened edge-score AUROC on most networks. Panzeri-Treves is also 12-120× slower than plug-in.
  • Second batch (#305): no improvement.
    • Panzeri-Treves has the lowest mean layer RMSE but is worse than Chao-Wang-Jost in most settings.
    • Quadratic extrapolation helps on catFR but not on the synthetic processes.
    • Unseen and PYM suppress the flow itself.
    • The Gaussian copula helps CausalRivers (AUROC 0.581 → 0.606) and hurts NetSim and short logistic series.
  • Rejected estimators: NSB and jackknife are accurate but far too slow (about 2,500× and 180× plug-in per entropy). Shrinkage, Laplace, Bonachela and asymptotic NSB are worse than Miller-Madow.

Tests

  • New tests check every estimator's layer CMI against dit's conditional_mutual_information, check the layer identities, check the selection CMI and the recovery of a chain under three estimators, and cover the single-outcome guard.
  • Full suite: 277 passed, 10 skipped (optional extras not installed).

Made with Cursor

Ryan James added 4 commits November 1, 2026 12:20
infer_multiplex(estimator=...) and the functions below it accept any of
dit.inference.estimators.ENTROPY_ESTIMATORS (intrinsic flow evaluated at the
hardened channel, since they need integer counts), and
SkeletonSettings(entropy_estimator=...) swaps the entropies in the plug-in
selection statistic. Defaults are unchanged. dit is moved to e3611818 for the
new estimators. Validation scripts and report: Chao-Wang-Jost lowers layer RMSE
25-30% against Miller-Madow at 300-1000 samples and spurious synergy on iEEG
2.5x; Miller-Madow selection raises recall by 0.05 at no cost.
DEFAULT_LAYER_ESTIMATOR = 'chao_wang_jost' for infer_multiplex, estimate_edge,
layer_statistics, crossfit_flows, the channel layer, and auto's cost pilot. The
selection statistic stays plug-in and compare_networks keeps Miller-Madow. On
VAR, logistic-map and Lorenz-96 networks it raised intrinsic-layer recall at
unchanged precision; NetSim and CausalRivers were unchanged. The uncoupled
false-positive test now counts runs with any false intrinsic or synergistic
flow.
Panzeri-Treves, quadratic extrapolation, Wu-Yang, BUB, unseen and PYM for layers
and selection, and the Gaussian copula via copula_normalize before auto.infer:
none beats the current defaults (report section 5). Single-outcome entropy terms
now return 0 for dit estimators (PYM rejects them). dit moves to 6314d14e, which
renamed prng to rng; total_correlation_ksg is now called with rng.
@Autoplectic
Autoplectic merged commit bb539c6 into main Nov 1, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant