Skip to main content

Module conjugate

Module conjugate 

Source
Expand description

Exact updates for conjugate priors (docs/semantics.md, section 14): the probability of an observation when its parameter is unknown, and the parameter’s distribution after it.

Probabilities are computed as logarithms. A run’s weight has an extended exponent, but one observation’s probability can already be far below the smallest f64: 0 successes out of 100,000 with a rate near 50% has a probability of e^−4234.

Enums§

Seen
What an observation saw, with its parameters besides the variable.

Functions§

is_prior
Whether a draw from family may be delayed: it’s the prior of a conjugate pair.
update
Observing seen, with the variable distributed as prior: the natural logarithm of the observation’s probability (a density for Normal), and the variable’s distribution after it. None if the two aren’t a conjugate pair. A logarithm of −∞ means the observation is impossible, like a count above the number of trials; the prior is returned then.