Skip to content

oracular / Prediction

Interface: Prediction ​

Defined in: types.ts:257

What predict returns for one intent at one moment.

Example ​

ts
const { p, lower, confidence, revealed, suppressedUntil } = predict(state, 'upgrade', now);

Properties ​

PropertyTypeDescriptionDefined in
confidencenumber1 − 2·sd, clamped to [0, 1]. A heuristic: 1 when the estimate is sharp, 0 when it is as vague as possible.types.ts:269
evidencenumberα + β: total pseudo-observations, prior strength included.types.ts:271
intentstring-types.ts:258
lowernumberThe lower confidence bound shouldReveal compares to the threshold: p − z·sd clamped to [0, 1], or with bound: 'exact' the Beta quantile at Φ(−z).types.ts:267
pnumberMean of the Beta distribution: α / (α + β).types.ts:260
revealedbooleanTrue while inside the cooldown that follows markRevealed.types.ts:273
revealedAtnumber | null-types.ts:274
sdnumberStandard deviation of the Beta distribution.types.ts:262
suppressedUntilnumber | nullWhen the current suppression ends: the later of the reveal cooldown (after markRevealed) and the outcome cooldown (after the outcome event) still running at at, or null when neither is. shouldReveal is false while this is non-null.types.ts:280

Released under the MIT License.