Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Bayesian evidence updates

An update starts with a prior probability p and two likelihoods: a = P(E | H) and b = P(E | not H). The posterior is:

posterior = p*a / (p*a + (1-p)*b)

The ratio a/b describes how diagnostic the observation is. It is not the same as the source’s credibility, and neither likelihood is P(H | E). Ask the two likelihood questions separately before looking at the desired posterior.

Numerically stable computation

bayes::update computes nondegenerate cases in log-odds space. This avoids underflow from multiplying tiny probabilities. Exact impossible evidence is an error: if neither hypothesis can produce the observation under the supplied prior, the model has failed.

extern crate supercast;
use supercast::{Probability as P, bayes};

let p = P::new(0.5)?;
let tiny = P::new(1e-310)?;
assert_eq!(bayes::update(p, tiny, tiny)?, p);
assert!(bayes::update(p, P::ZERO, P::ZERO).is_err());
Ok::<(), supercast::Error>(())

A dogmatic prior of zero or one generally cannot learn from finite, nonzero likelihood ratios. Ordinary uncertain forecasts should avoid those endpoints unless the outcome is logically determined under the model. Supercast permits endpoints as valid probabilities but does not quietly replace them with an epsilon.

Condition on what was already known

For a second observation, use P(E2 | H, E1) and P(E2 | not H, E1). Multiplying two marginal likelihood ratios implicitly assumes conditional independence. Two articles copying the same press release are not two observations.

The in-memory UpdateSession accepts prior-origin IDs and rejects a reused evidence origin. The durable update_forecast operation collects origins from previous forecast evidence and stores every likelihood pair with the resulting revision. Repeated evidence in a batch and origins from earlier revisions are rejected.

An origin ID refers to the underlying observation. A continuing source can produce multiple distinct observations; give those distinct origin IDs and condition the likelihoods on earlier information. Renaming an old observation to apply it twice defeats the modeling contract even if the strings pass validation.

Sensitivity and qualitative updates

When likelihoods are judgmental, provide a range of defensible inputs. For a 0.30 prior, LR 2 yields about 0.462 and LR 6 yields 0.72. bayes::sensitivity returns these endpoints as an assumption envelope.

If the evidence does not support numeric likelihoods, record a qualitative assessment or a manual judgmental revision with that limitation. Do not back-solve a likelihood ratio merely to disguise a preferred final probability as a measured update.

Silence is evidence only when the observation process makes it diagnostic. An empty incomplete news feed does not establish that an incident did not happen.