Wikipedia / Conjugate prior
Wikipedia / Conjugate prior
In Bayesian probability theory, if, given a likelihood function, the posterior distribution is in the same probability distribution family as the prior probability distribution, the prior and posterior are then called conjugate distributions with respect to that likelihood function and the prior is called a conjugate prior.
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 Bernoulli trials with unknown in [0,1]. This random variable will follow the binomial distribution, with a probability mass function of the form
The usual conjugate prior is the beta distribution):
would give a uniform distribution is the Beta function acting as a normalising constant.
are called hyperparameterss). 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.)
failures, then we have
. 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.
Interpretations
Pseudo-observations
It is often useful to think of the hyperparameters of a conjugate prior distribution corresponding to having observed a certain number of pseudo-observations of a beta distribution failures if the posterior mean is used to choose an optimal parameter setting. In general, for nearly all conjugate prior distributions, the hyperparameters can be interpreted in terms of pseudo-observations. This can help provide intuition behind the often messy update equations and help choose reasonable hyperparameters for a prior.
Dynamical system
One can think of conditioning on conjugate priors as defining a kind of (discrete time) dynamical system: from a given set of hyperparameters, incoming data updates these hyperparameters, so one can see the change in hyperparameters as a kind of "time evolution" of the system, corresponding to "learning". Starting at different points yields different flows over time. This is again analogous with the dynamical system defined by a linear operator, but note that since different samples lead to different inferences, this is not simply dependent on time but rather on data over time. For related approaches, see Recursive Bayesian estimation and Data assimilation.
Practical example
Suppose a rental car service operates in your city. Drivers can drop off and pick up cars anywhere inside the city limits. You can find and rent cars using an app.
Suppose you wish to find the probability that you can find a rental car within a short distance of your home address at any time of day.
Suppose we assume the data comes from a Poisson distribution. In that case, we can compute the maximum likelihood
This is the Poisson distribution that is the, etc. In fact, there is an infinite number of Poisson distributions that could.
Generally, this quantity is known as the posterior predictive distribution are the parameters of the model. Using Bayes' theorem, a closed-form expression can be derived. This is the posterior predictive column in the tables below.
Returning to our example, if we pick the Gamma distribution as our prior distribution over the rate of the Poisson distributions, then the posterior predictive is the negative binomial distribution, which seems to be a reasonable prior for the average number of cars. The choice of prior hyperparameters is inherently subjective and based on prior knowledge.
This much more conservative estimate reflects the uncertainty in the model parameters, which the posterior predictive takes into account.
Table of conjugate distributions
Let n denote the number of observations. In all cases below, the data is assumed to consist of n (which will be random vectors in the multivariate cases).
If the likelihood function belongs to the exponential family, then a conjugate prior exists, often also in the exponential family; see Exponential family: Conjugate distributions.
When the likelihood function is a discrete distribution
Likelihood | Model parameters | Conjugate prior (and posterior) distribution | Prior hyperparameters | Posterior hyperparameters | Interpretationofhyperparameters | Posteriorpredictive |
p (probability) | failures | |||||
Binomialwith known number of trials, N_i | p (probability) | failures | ||||
Negative binomialwith known failure number, r | p (probability) | failures stays fixed) | ||||
λ (rate) | intervals | |||||
| intervals | |||||
p (probability vector), k (number of categories; i.e., size of p) | is the number of observations in category i | |||||
p (probability vector), k (number of categories; i.e., size of p) | ||||||
Hypergeometricwith known total population size, N | M (number of target members) | failures | ||||
p0 (probability) | total failures |
When likelihood function is a continuous distribution
Likelihood | Model parameters | Prior hyperparameters | Posterior hyperparameters | Interpretationofhyperparameters | Posteriorpredictive |
Normalwith known variance σ2 | μ (mean) | ||||
Normalwith known precision τ | μ (mean) | ||||
Normalwith known mean μ | σ2 (variance) |
| (i.e. with sum of squared deviations) | ||
Normalwith known mean μ | σ2 (variance) | ||||
Normalwith known mean μ | τ (precision) |
| (i.e. with sum of squared deviations) | ||
μ and σ2Assuming exchangeability |
| and sum of squared deviations | |||
μ and τAssuming exchangeability |
| and sum of squared deviations | |||
Multivariate normal with known covariance matrix Σ | μ (mean vector) |
| |||
Multivariate normal with known precision matrix Λ | μ (mean vector) |
| |||
Multivariate normal with known mean μ | Σ (covariance matrix) | ||||
Multivariate normal with known mean μ | Λ (precision matrix) | ||||
μ (mean vector) and Σ (covariance matrix) |
| ||||
μ (mean vector) and Λ (precision matrix) |
| ||||
Pareto with known minimum xm | k (shape) | of the order of magnitude) | |||
Weibull with known shape β | θ (scale) | of the βth power of each observation | |||
Same as for the normal distribution after applying the natural logarithm to the data for the posterior hyperparameters. Please refer to to see the details. | |||||
λ (rate) |
|
| |||
Gamma with known shape α | β (rate) |
| |||
Inverse Gamma with known shape α | β (inverse scale) | ||||
Gamma with known rate β | α (shape) | ||||
α (shape), β (inverse scale) | |||||
α, β |
See also
Notes
References