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
| Property | Type | Description | Defined in |
|---|---|---|---|
confidence | number | 1 − 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 |
evidence | number | α + β: total pseudo-observations, prior strength included. | types.ts:271 |
intent | string | - | types.ts:258 |
lower | number | The 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 |
p | number | Mean of the Beta distribution: α / (α + β). | types.ts:260 |
revealed | boolean | True while inside the cooldown that follows markRevealed. | types.ts:273 |
revealedAt | number | null | - | types.ts:274 |
sd | number | Standard deviation of the Beta distribution. | types.ts:262 |
suppressedUntil | number | null | When 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 |