Skip to content

Commit 84ca7bb

Browse files
committed
fix(scoring): correct CBF baseRate denominator — Jøsang SL §12.3
aDenomBase must be u_A + u_B - 2·u_A·u_B. Previous code used (denom - 2·u_A·u_B) where denom already included -u_A·u_B, making it u_A + u_B - 3·u_A·u_B — off by one term. With equal baseRates (always 0.5) the correct formula collapses to 0.5. The wrong formula produced baseRate ≈ 1.9 when uncertainty is high, causing projectScore() to exceed 1.0 (→ 100+ clipped to 100). Visible symptom: github:tankcdr scored 100 with weak signals (github score 0.50, twitter score 0.20) while github:vbuterin scored 78 with strong signals (github score 0.80, confidence 0.95). After fix: tankcdr ≈ 46, vbuterin ≈ 79.
1 parent 74e4130 commit 84ca7bb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/core/src/engine/scoring.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@ export function fuseTwo(a: Opinion, b: Opinion): Opinion {
5151
if (Math.abs(a.uncertainty - 1) < 1e-10) return { ...b };
5252
if (Math.abs(b.uncertainty - 1) < 1e-10) return { ...a };
5353

54+
// Correct per Jøsang SL §12.3: denominator for baseRate is u_A + u_B - 2·u_A·u_B
55+
// NOT (u_A + u_B - u_A·u_B) - 2·u_A·u_B which was off by one u_A·u_B term.
56+
// When both baseRates equal 0.5 (always) this correctly collapses to 0.5;
57+
// the wrong formula produced baseRate ≈ 1.9 when uncertainty is high, inflating scores past 100.
5458
const aDenomBase =
55-
denom - 2 * a.uncertainty * b.uncertainty;
59+
a.uncertainty + b.uncertainty - 2 * a.uncertainty * b.uncertainty;
5660

5761
return {
5862
belief:

0 commit comments

Comments
 (0)