Skip to content
Kudos AI

Bayesian Inference Playground

Prior to posterior updating with conjugate families, alongside an entropy and KL-divergence explorer that measures what each observation actually told you.

Python (NumPy, SciPy)active

An interactive treatment of belief updating. The inference half implements conjugate updating - beta-binomial, gamma-Poisson, normal-normal - and shows the posterior moving as evidence arrives, including the case that surprises most readers: with a low enough base rate, a positive result from an accurate test still leaves the hypothesis unlikely. Sequential updating is made explicit, with yesterday's posterior used as today's prior and the result shown to be identical to a single batch update. The information half quantifies the same process: entropy of the prior and posterior, and the KL divergence between them as a direct measure of how much a given observation moved belief. That connects the probability articles to the information-theory one, where the same quantities reappear as the loss functions used to train models. Implementation is in progress and no source repository has been published yet.

Highlights

  • Beta-binomial, gamma-Poisson, and normal-normal conjugate updates implemented directly
  • Sequential updating shown to agree exactly with a single batch update
  • Base-rate case worked numerically, where an accurate test still leaves the hypothesis unlikely
  • Entropy and KL divergence used to quantify how much each observation moved belief

Related articles

7 min readProbability Foundations

Probability from Zero: The Language of Uncertainty

Build probability from the ground up: possible worlds, the sample space, the two basic axioms, and the addition and multiplication rules, each derived rather than asserted, with worked numeric examples.

ProbabilityMathematicsArtificial Intelligence
6 min readProbability Foundations

Bayes' Theorem and Belief Updating

Derive Bayes' theorem from the definition of conditional probability, then work the base-rate example that fools almost everyone, twice: once with the formula and once by pure counting.

ProbabilityMathematicsArtificial Intelligence
10 min readProbability Foundations

Entropy and Information

Measuring uncertainty in bits: Shannon entropy and why the logarithm is base 2, information gain worked on a split, and how cross-entropy and KL divergence relate to entropy and to the loss functions used to train classifiers.

Information TheoryProbabilityMathematics