Hexa Scholar

Prior times likelihood: a posterior update

A magnifying glass in front of a plain gold coin standing in a navy tray.
A coin under a magnifying glass: examining evidence about an unknown probability.

The question

Commit to a direction before the new distribution appears.

  1. 1 SeePredict, then add a coin result.
  2. 2 TryCompare the weight of two priors.
  3. 3 ProveBuild a normalized posterior.
  4. 4 ApplyCompute and interpret five updates.
Before you start · 3 quick checks on conditioning, independence and density

Two ideas before you start

2 ideas

A distribution describes uncertainty about a parameter

Two selectable symmetric prior densities over the coin's heads probability.

The coin has one fixed, unknown heads probability. The prior curve describes uncertainty about that probability before these data are used.

Exact definition

Write \(p\) for the probability of heads, with \(0\lt p\lt1\). A prior density \(\pi(p)\) is nonnegative and integrates to one. Its area over an interval is the prior probability assigned to that interval. Its height at a single point is not a point probability.

This page uses beta densities with positive integer parameters \(a,b\):

\[\begin{aligned}\pi(p)&=\frac{p^{a-1}(1-p)^{b-1}}{B(a,b)},\\B(a,b)&=\int_0^1 u^{a-1}(1-u)^{b-1}\,du.\end{aligned}\]

The symbol \(u\) is only the integration variable. A beta prior assigns no point mass to either endpoint. Changing the curve changes the assumed prior information, not the coin itself.

Hold the data fixed; vary the candidate

The likelihood of the ordered sequence heads, tails over candidate heads probabilities.

For the displayed sequence heads, tails, compare how well each candidate explains the same observations. The likelihood is a function of the candidate.

Exact definition

Conditional on the same fixed \(p\), tosses are independent Bernoulli trials: heads has probability \(p\), tails has probability \(1-p\). An observed ordered sequence \(D\) with \(h\) heads and \(t\) tails has likelihood

\[L(p)=P(D\mid p)=p^h(1-p)^t.\]

The observed sequence stays fixed while \(p\) varies. Unlike a density over \(p\), a likelihood need not integrate to one. The lesson on maximum likelihood searches for its largest value. Here the goal is a whole distribution after observing data.

Refresher: beta integrals and what is being counted

No earlier lesson on beta distributions is needed. For positive integers, integration by parts gives \(B(a,b)=(a-1)!(b-1)!/(a+b-1)!\), with \(0!=1\). Dividing the beta integral with its first parameter increased by one by the original integral gives the mean \(a/(a+b)\). These identities are the calculation tools used below.

Conditional independence is essential. After averaging over an uncertain shared \(p\), tosses need not be independent. A long run of heads can change what you expect from the next toss without physically changing the coin.

The binomial count in the binomial and Poisson lesson includes a counting factor for all sequences with the same counts. For fixed sample size that factor does not depend on \(p\), so it cancels from a posterior. We use the ordered-sequence likelihood throughout. The event-probability version of the update is covered in Bayes' theorem and base rates.

1 See

Add one result

These are supplied observations, not simulated tosses. The model assumes a fixed heads probability and independent tosses conditional on that probability. “Moves” refers to the mean, not a rigid translation of the curve.

2 Try

Same observations, different priors

Both priors below have the same mean. Before comparing their updated values, decide what a difference in prior concentration will do. This comparison uses a new fixed batch of conditionally independent tosses.

3 Prove

Multiply, then normalize

Theorem

Assume a Beta(a, b) prior with positive integer parameters and one fixed \(p\) in the open unit interval. Given \(p\), the tosses are independent, each with heads probability \(p\). Observe a particular ordered sequence with nonnegative integer counts \(h,t\) and \(n=h+t\ge1\).

Define the unnormalized product \(u(p)=\pi(p)L(p)\) and its area \(Z=\int_0^1u(p)\,dp\). Then

\[\begin{aligned}\pi(p\mid D)&=\frac{\pi(p)L(p)}{Z},\\p\mid D&\sim\operatorname{Beta}(a+h,b+t).\end{aligned}\]

For these assumptions \(0\lt Z\lt1\), so normalization is possible. Here \(Z=P(D)\) is the prior predictive probability of this particular sequence, not the probability of a chosen parameter. The posterior is a Bayesian statement: it describes uncertainty about \(p\) given the chosen prior and the sampling model. Its interval probabilities are not model-free probabilities that a claim about the coin is true; a different prior gives a different posterior. The proof uses the definition of conditional density and the beta integral defined on Start.

Each option concerns the assumptions above and an interior candidate p. Nonempty data make its sequence likelihood strictly between zero and one.

4 Apply

Compute and interpret an update

Each problem has a hint and a worked solution. Enter a decimal; answers within the displayed tolerance of the unrounded value are accepted. Keep separate a parameter value, a density height and an area probability.

Key point First state the sampling model and the prior. Then form the likelihood, normalize the product, and identify what the requested number means. A posterior mean is not proof that the parameter equals that value.
Level UndergraduatePrerequisites Conditional probability, likelihood and density; beta integrals refreshed on StartTime About 30 min

Further reading