Skip to content

fix(graphical): EP statistics completion — F6 truncated KL + F7(b) evidence recording #1353

Closed

Description

@Jammy2211

Overview

The last two statistical legs from the #1332 audit, now that F1-F5/F7a/F7c/F8/F10 have landed (#1345/#1348/#1334/#1349/#1351):

  • F6 — TruncatedNormalMessage.kl uses the untruncated Gaussian formula; the error grows as posterior mass approaches the bounds. Live in HowToFit ch3 tutorial 5's EP convergence metric (af.TruncatedGaussianPrior). Fix: compute KL from truncated moments (mean/variance of the truncated normal via the standard hazard-function expressions), with the exact same-support case first and a documented approximation policy for mismatched supports.
  • F7(b) — MeanField.from_priors (the projection behind every search-driven factor update) constructs with log_norm = 0, so the sampler's per-factor evidence never enters the mean field and EPMeanField.log_evidence cannot be trusted for model comparison in sampler-driven fits. Design decision + implementation: record the search's log-evidence in the projected mean field's log_norm (recommendation to be posted after code inspection; README §5 documents the intended evidence algebra).
  • Plus the README §6 sharpening from the research: EP review phase 5 — reconcile the three deterministic-variable mechanisms #1336 Recommendation-A adoption (decision recorded on research: EP review phase 5 — reconcile the three deterministic-variable mechanisms #1336, closed).

Validation: full suite; MC-vs-analytic KL tests for the truncated family (extending the #1351 direction property test); an evidence round-trip test (EP log_evidence vs analytic on the exact-conjugate toy); EP integration smoke (parity/deterministic/exact).

Autonomy: supervised (--auto chain, human directed 2026-07-10). Suggested branch feature/ep-statistics-completion.

Activity

  1. Jammy2211 commented on Jul 10, 2026

    @Jammy2211
    CollaboratorAuthor

    Shipped at PR-open — #1354

    F6 (exact truncated KL, MC-verified ×3 geometries) + F7(b) (sampler evidence recorded on log_norm per the README §5 contract — all three F7 legs now fixed, evidence trustworthy with nested factor searches) + the #1336 Rec-A doc in §6. Suite 1474/14 with only the documented #1352 order-dependent failure; EP smoke 3/3 (one stale-resume-cache false alarm cleared); test_static regression caught in-suite and fixed (two-level getattr). Heart YELLOW, same acked set. Merge stays human.

  2. Jammy2211 commented on Jul 10, 2026

    @Jammy2211
    CollaboratorAuthor

    Merged — ffc04d83 via #1354. The #1332 audit's statistical findings are now fully dispersed: F1-F8 + F10 fixed/exonerated across #1345/#1348/#1334/#1349/#1351/#1354; F9 (scipy private import) remains a small chore; F7 evidence bookkeeping complete. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions