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

Decompose without inventing independence

Decomposition makes assumptions inspectable. It improves a forecast only when the pieces are informative and their dependence is handled correctly.

Conjunctions

The chain rule is P(A and B) = P(A) * P(B | A). In a longer chain, each factor conditions on the relevant preceding events. conditional_chain multiplies supplied factors; its name makes the required interpretation explicit.

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

let launch = decompose::conditional_chain(&[
    P::new(0.8)?, // dependency completes
    P::new(0.6)?, // launch succeeds given dependency completion
])?;
assert!((launch.get() - 0.48).abs() < 1e-12);
Ok::<(), supercast::Error>(())

Do not supply two marginal estimates unless independence is actually justified. A common cause, such as a staffing shortage, can affect both components.

Unions and bounds

For two events, P(A or B) = P(A) + P(B) - P(A and B). If overlap is unknown, report bounds:

intersection: max(0, pA + pB - 1) .. min(pA, pB)
union:        max(pA, pB)         .. min(1, pA + pB)

decompose::union rejects a supplied intersection outside those bounds. The JSON union command returns both bounds and an exact union only if an intersection was supplied; otherwise its union field is null.

Scenario mixtures

A weighted mixture assumes disjoint, exhaustive scenarios. Weights must sum to one within the documented floating-point tolerance. If scenarios overlap, the weighted sum double-counts; if a pathway is missing, add an explicit “other” scenario.

For an indicator C, a simple mixture is P(U) = P(C)*P(U|C) + P(not C)*P(U|not C). The indicator primitive adds a coherence check and expected information gain to this model.

Counts and deadline events

A product of dimensional factors may estimate an expected count rather than the probability of any occurrence. Under a justified Poisson model with constant rate lambda, the probability of at least one event in duration t is 1 - exp(-lambda*t).

event_probability evaluates this expression with expm1 for precision at small rates. Its rate and duration must use compatible units. For a remaining-window forecast, the model conditions on survival to the window’s start. Clustering, bursts, or changing hazards can make a constant-hazard model unsuitable.

Stop decomposing when another factor would add unsupported precision without changing the conclusion or decision. More factors can multiply guesses as easily as they can combine evidence.