From 1445c088968cc21e49d9b02aa45c4adfa48475ac Mon Sep 17 00:00:00 2001 From: Anders Olsson Date: Fri, 8 May 2026 14:37:58 +0200 Subject: [PATCH] docs: fix stale numerics in t4-margin-factor plan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The plan's prose quoted Z_cav ≈ 0.046827 and log_evidence ≈ -3.0613, which diverged from the values asserted by the shipped test in src/factor/mod.rs (-3.062235327364623). Update prose and the matching code comment to 0.04678 / -3.0622. --- docs/superpowers/plans/2026-04-27-t4-margin-factor.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/superpowers/plans/2026-04-27-t4-margin-factor.md b/docs/superpowers/plans/2026-04-27-t4-margin-factor.md index 52997b7..6964379 100644 --- a/docs/superpowers/plans/2026-04-27-t4-margin-factor.md +++ b/docs/superpowers/plans/2026-04-27-t4-margin-factor.md @@ -49,7 +49,7 @@ A Gaussian `N(m, σ)` constructed via `Gaussian::from_ms(m, σ)`. Multiplication **Concrete numerical check for tests:** With cavity `N(0, 6)` and observation `m_obs=5, σ=1`: - `D_cav.pi = 1/36 ≈ 0.027778`, `D_cav.tau = 0`. - New marginal: `pi = 0.027778 + 1 = 1.027778`, `tau = 0 + 5 = 5`. So `mu = 5 / 1.027778 ≈ 4.864865`, `sigma = 1/sqrt(1.027778) ≈ 0.986394`. -- `Z_cav = pdf(5, 0, sqrt(36 + 1)) = pdf(5, 0, sqrt(37)) ≈ 0.046827`. So `log_evidence ≈ -3.0613`. +- `Z_cav = pdf(5, 0, sqrt(36 + 1)) = pdf(5, 0, sqrt(37)) ≈ 0.04678`. So `log_evidence ≈ -3.0622`. --- @@ -182,7 +182,7 @@ mod tests { f.propagate(&mut vars); let z = f.evidence_cached.unwrap(); - // pdf(5, 0, sqrt(37)) ≈ 0.046827 + // pdf(5, 0, sqrt(37)) ≈ 0.04678 assert!((z - 0.04682752233851171).abs() < 1e-10); // Subsequent propagations don't change it.