Lably
Skip to content

Conjugate prior

Concept in probability theory

  • 5 min read
  • 4 chapters

Related on Lably

Through Likelihood function, Random variable and Bernoulli trial

A conjugate prior is an algebraic convenience, giving a closed-form expression for the posterior; otherwise, numerical integration may be necessary. Further, conjugate priors may clarify how a likelihood function updates a prior distribution.

The concept, as well as the term "conjugate prior", were introduced by Howard Raiffa and Robert Schlaifer in their work on Bayesian decision theory. A similar concept had been discovered independently by George Alfred Barnard.

Example

The form of the conjugate prior can generally be determined by inspection of the probability density or probability mass function of a distribution. For example, consider a random variable which consists of the number of successes s in n Bernoulli trials with unknown probability of success q in [0,1]. This random variable will follow the binomial distribution, with a probability mass function of the form

p(s)=(ns)qs(1−q)n−s

The usual conjugate prior is the beta distribution with parameters (α, β):

p(q)=qα−1(1−q)β−1B(α,β)

where α and β are chosen to reflect any existing belief or information (α=1 and β=1 would give a uniform distribution) and B(α,β) is the Beta function acting as a normalising constant.

In this context, α and β are called hyperparameters (parameters of the prior), to distinguish them from parameters of the underlying model (here q). A typical characteristic of conjugate priors is that the dimensionality of the hyperparameters is one greater than that of the parameters of the original distribution. If all parameters are scalar values, then there will be one more hyperparameter than parameter; but this also applies to vector-valued and matrix-valued parameters. (See the general article on the exponential family, and also consider the Wishart distribution, conjugate prior of the covariance matrix of a multivariate normal distribution, for an example where a large dimensionality is involved.)

If we sample this random variable and get s successes and f=n−s failures, then we have

P(s,f∣q=x)=(s+fs)xs(1−x)f,P(q=x)=xα−1(1−x)β−1B(α,β),P(q=x∣s,f)=P(s,f∣x)P(x)∫P(s,f∣y)P(y)dy=(s+fs)xs+α−1(1−x)f+β−1/B(α,β)∫y=01((s+fs)ys+α−1(1−y)f+β−1/B(α,β))dy=xs+α−1(1−x)f+β−1B(s+α,f+β),

which is another Beta distribution with parameters (α+s,β+f). This posterior distribution could then be used as the prior for more samples, with the hyperparameters simply adding each extra piece of information as it comes.

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Statistics