liveBook · Manning

Conjugacy

As explained in Machine Learning Algorithms in Depth

A conjugate prior is a prior distribution whose posterior belongs to the same distributional family after updating with data.

A prior is conjugate to a likelihood when updating it with observed data produces a posterior in the same distributional family. For parameters θ and data D, Bayes’ rule gives p(θ|D) = p(D|θ)p(θ)/p(D). Conjugacy makes the update closed-form: new data change the prior’s parameters without requiring a different form of posterior. The normalizing term p(D) can otherwise require an intractable integral. section 1.4

Coin-flip updates

Let θ be the probability of heads. A Beta prior can encode counts from earlier coin flips; after observing more heads and tails, update those counts. The posterior is again Beta, so the same kind of update can be repeated as data arrive. section 2.1.1 section 1.4

Conjugacy also offers a way to smooth count-based estimates in Bernoulli naive Bayes: Beta priors can be added for Bernoulli variables, and a Dirichlet prior for class probabilities. Another pairing to verify is a Dirichlet prior with a multinomial likelihood: compute the posterior and inspect how its shape changes with the resulting counts. section 5.5 section 8.4

How Machine Learning Algorithms in Depth covers it

How deep it goes
Works through Beta posterior count updates for coin flips but leaves the Dirichlet–multinomial posterior as an exercise.
Examples
Uses coin-flip counts, Bernoulli naive Bayes, and a Dirichlet–multinomial posterior exercise.
What it assumes
Assumes familiarity with Bayes’ rule and probability distributions while defining conjugacy through prior-to-posterior updates.
What you can do after
Build it from scratch for coin flips by updating Beta prior counts with observed heads and tails.
How it connects
Connects Bayes’ rule and posterior distributions to Bernoulli naive Bayes and count smoothing.

Also explained in

Compare how 3 books explain conjugacy →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning Algorithms in Depth. The section links point to the parts of the book it draws on.