# Conjugate priors

A conjugate prior has the same functional form in q as the likelihood function which leads to a posterior distribution belonging to the same distribution family as the prior. For example, the Beta(a1,a2) distribution has probability mass function f(q) given by:

The denominator is a constant for particular values of a1 and a2, so we can rewrite the equation as:

(1)

If we had observed s successes in n trials and were attempting to estimate the true probability of success p, the likelihood function l(s,n;q) would be given by the binomial distribution probability mass function written (using q to represent the unknown parameter p):

Since the binomial coefficient  is constant for the given data set (i.e. known n, s), we can rewrite the equation as:

(2)

We can see that the Beta distribution and the binomial likelihood function have the same functional form in q, i.e. q a.(1-q)b, where a and b are constants. Since the posterior distribution is a product of the prior and likelihood function, it too will have the same functional form, i.e. combining Equations 1 and 2 we have:

(3)

We know from the form that this is a Beta(a1+s, a2+n-s)  distribution, so the posterior density is actually:

With a bit of practice, one starts to recognise distributions because of their functional form, without having to go through the step of obtaining the normalized equation. Thus if one uses a Beta distribution as a prior for p with a binomial likelihood function, the posterior distribution is also a Beta. The value of using conjugate priors is that we can avoid actually doing any of the mathematics and get directly to the posterior distribution by simply updating the parameters of the prior distribution. Conjugate priors are often called convenience priors for obvious reasons.

The Beta(1, 1) distribution is the same as a Uniform(0, 1) distribution, so if we want to start with a Uniform(0, 1) prior for p, which makes intuitive sense and also mathematical sense from the viewpoint of MaxEnt, our posterior distribution is given by Beta(s+1, n-s+1). This is a particularly useful result in modelling binomial processes. The Jeffreys prior for a binomial probability is a Beta(½ ,½ ), which peaks at zero and one, but holds to one philosophy of an uninformed prior. Some modellers using a Beta(0, 0) prior which is mathematically undefined and therefore meaningless by itself, giving a posterior distribution of Beta(s, n-s) which has a mean of s/n: in other words it provides an unbiased estimate for the binomial probability (a property many statisticians prefer), but has a mode of (s-1)/(n-2) which is not intuitive, and doesn't work if s=0 or n.

The following table lists other conjugate priors and the associated likelihood functions. Exponential families of distributions, from which one often draws the likelihood function, all have conjugate priors so the technique can be used frequently in practice. Conjugate priors are also often used to provide approximate but very convenient representations to subjective priors.

 Table of likelihood functions and their conjugate distributions Likelihood functions Information Estimated parameter Prior Posterior Multinomial s1,s2,..sk successes in k categories Probabilities p1,p2,..pk Dirichlet(a1,a2,..ak) Binomial s successes in n trials Probability p Beta(a1,a2) Exponential n "times" xi mean-1 = l Gamma(a,b) Normal (with known s) n data values with mean Mean m Normal(mm,sm) Poisson a observations in time t Mean events per unit time l Gamma(a,b)

### FREE MONTE CARLO SIMULATION SOFTWARE

##### For Microsoft Excel

Download your free copy of ModelRisk Basic today. Professional quality risk modeling software and no catches