Conjugate prior

Conjugate prior

In Bayesian probability theory, if the posterior distributions p(θ|x) are in the same family as the prior probability distribution p(θ), the prior and posterior are then called conjugate distributions, and the prior is called a conjugate prior for the likelihood. For example, the Gaussian family is conjugate to itself (or self-conjugate) with respect to a Gaussian likelihood function: if the likelihood function is Gaussian, choosing a Gaussian prior over the mean will ensure that the posterior distribution is also Gaussian. The concept, as well as the term "conjugate prior", were introduced by Howard Raiffa and Robert Schlaifer in their work on Bayesian decision theory.[1] A similar concept had been discovered independently by George Alfred Barnard.[2]

Consider the general problem of inferring a distribution for a parameter θ given some datum or data x. From Bayes' theorem, the posterior distribution is equal to the product of the likelihood function \theta \mapsto p(x\mid\theta)\! and prior p(θ), normalized (divided) by the probability of the data p(x):

 p(\theta|x) = \frac{p(x|\theta) \, p(\theta)}
  {\int p(x|\theta) \, p(\theta) \, d\theta}. \!

Let the likelihood function be considered fixed; the likelihood function is usually well-determined from a statement of the data-generating process. It is clear that different choices of the prior distribution p(θ) may make the integral more or less difficult to calculate, and the product p(x|θ) × p(θ) may take one algebraic form or another. For certain choices of the prior, the posterior has the same algebraic form as the prior (generally with different parameter values). Such a choice is a conjugate prior.

A conjugate prior is an algebraic convenience, giving a closed-form expression for the posterior: otherwise a difficult numerical integration may be necessary. Further, conjugate priors may give intuition, by more transparently showing how a likelihood function updates a distribution.

All members of the exponential family have conjugate priors. See Gelman et al.[3] for a catalog.

Contents

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 is a Bernoulli trial with unknown probability of success q in [0,1]. The probability density function has the form

p(x) = qx(1 − q)1 − x

Expressed as a function of q, this has the form

f(q) \propto q^a (1-q)^b

for some constants a and b. Generally, this functional form will have an additional multiplicative factor (the normalizing constant) ensuring that the function is a probability distribution, i.e. the integral over the entire range is 1. This factor will often be a function of a and b, but never of q.

In fact, the usual conjugate prior is the beta distribution with

p(q) = {q^{\alpha-1}(1-q)^{\beta-1} \over \Beta(\alpha,\beta)}

where α and β are chosen to reflect any existing belief or information (α = 1 and β = 1 would give a uniform distribution) and Β(αβ) 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). It is a typical characteristic of conjugate priors 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 this means that 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 consider also 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 then sample this random variable and get s successes and f failures, we have

P(s,f|q=x) = {s+f \choose s} x^s(1-x)^f,
p(q=x|s,f) = {{{s+f \choose s} x^{s+\alpha-1}(1-x)^{f+\beta-1} / \Beta(\alpha,\beta)} \over  \int_{y=0}^1 \left({s+f \choose s} y^{s+\alpha-1}(1-y)^{f+\beta-1} / \Beta(\alpha,\beta)\right) dy} = {x^{s+\alpha-1}(1-x)^{f+\beta-1} \over \Beta(s+\alpha,f+\beta)} ,

which is another Beta distribution with a simple change to the (hyper)parameters. 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

Analogy with eigenfunctions

Conjugate priors are analogous to eigenfunctions in operator theory, in that they are distributions on which the "conditioning operator" acts in a well-understood way, thinking of the process of changing from the prior to the posterior as an operator.

In both eigenfunctions and conjugate priors, there is a finite dimensional space which is preserved by the operator: the output is of the same form (in the same space) as the input. This greatly simplifies the analysis, as it otherwise considers an infinite dimensional space (space of all functions, space of all distributions).

However, the processes are only analogous, not identical: conditioning is not linear, as the space of distributions is not closed under linear combination, only convex combination, and the posterior is only of the same form as the prior, not a scalar multiple.

Just as one can easily analyze how a linear combination of eigenfunctions evolves under application of an operator (because, with respect to these functions, the operator is diagonalized), one can easily analyze how a convex combination of conjugate priors evolves under conditioning; this is called using a hyperprior, and corresponds to using a mixture density of conjugate priors, rather than a single conjugate 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 inference, this is not simply dependent on time, but rather on data over time.

Table of conjugate distributions

Let n denote the number of observations.

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.

Discrete likelihood distributions

Likelihood Model parameters Conjugate prior distribution Prior hyperparameters Posterior hyperparameters
Bernoulli p (probability) Beta \alpha,\, \beta\! \alpha + \sum_{i=1}^n x_i,\, \beta + n - \sum_{i=1}^n x_i\!
Binomial p (probability) Beta \alpha,\, \beta\! \alpha + \sum_{i=1}^n x_i,\, \beta + \sum_{i=1}^nN_i - \sum_{i=1}^n x_i\!
Negative Binomial p (probability) Beta \alpha,\, \beta\! \alpha + rn,\, \beta + \sum_{i=1}^n x_i\!
Poisson λ (rate) Gamma k,\, \theta\! k+ \sum_{i=1}^n x_i,\ \frac {\theta} {n \theta  + 1}\!
Poisson λ (rate) Gamma \alpha,\, \beta\! [4] \alpha + \sum_{i=1}^n x_i ,\ \beta + n\!
Multinomial p (probability vector) Dirichlet \vec{\alpha}\! \vec{\alpha}+\sum_{i=1}^n\vec{x}^{\,(i)}\!
Geometric p0 (probability) Beta \alpha,\, \beta\! \alpha + n,\, \beta + \sum_{i=1}^n x_i\!

Continuous likelihood distributions

Likelihood Model parameters Conjugate prior distribution Prior hyperparameters Posterior hyperparameters
Uniform  U(0,\theta)\! Pareto  x_{m},\, k\!  \max\{\,x_{(n)},x_{m}\},\, k+n\!
Exponential λ (rate) Gamma \alpha,\, \beta\! [4] \alpha+n,\, \beta+\sum_{i=1}^n x_i\!
Normal
with known variance σ2
μ (mean) Normal \mu_0,\, \sigma_0^2\! \left.\left(\frac{\mu_0}{\sigma_0^2} + \frac{\sum_{i=1}^n x_i}{\sigma^2}\right)\right/\left(\frac{1}{\sigma_0^2} + \frac{n}{\sigma^2}\right),\, \left(\frac{1}{\sigma_0^2} + \frac{n}{\sigma^2}\right)^{-1}
Normal
with known precision τ
μ (mean) Normal \mu_0,\, \tau_0\!  \left.\left(\tau_0 \mu_0 + \tau \sum_{i=1}^n x_i\right)\right/(\tau_0 + n \tau),\, \tau_0 + n \tau
Normal
with known mean μ
σ2 (variance) Scaled inverse chi-squared \nu,\, \sigma_0^2\! \nu+n,\, \frac{\nu\sigma_0^2 + \sum_{i=1}^n (x_i-\mu)^2}{\nu+n}\!
Normal
with known mean μ
τ (precision) Gamma \alpha,\, \beta\![4] \alpha + \frac{n}{2},\, \beta + \frac{\sum_{i=1}^n (x_i-\mu)^2}{2}\!
Normal
with known mean μ
σ2 (variance) Inverse Gamma Distribution  \mathbf{\alpha,\, \beta} [5]  \mathbf{\alpha}+\frac{n}{2},\, \mathbf{\beta} + \frac{\sum_{i=1}^n{(x_i-\mu)^2}}{2}
Normal μ and σ2
Assuming exchangeability
Normal-scaled inverse gamma  \lambda ,\, \nu ,\, \alpha ,\, \beta \frac{\nu\lambda+n\bar{x}}{\nu+n} ,\, \nu+n,\, \alpha+\frac{n}{2} ,\, 
\beta + \tfrac{1}{2} \sum_{i=1}^n (x_i - \bar{x})^2 + \frac{n\nu}{n+\nu}\frac{(\bar{x}-\lambda)^2}{2} , where  \bar{x} is the sample mean.
Normal μ and τ
Assuming exchangeability
Normal-gamma  \lambda,\, \gamma,\, \alpha,\, \beta\  \frac{\lambda \gamma+n\bar{x}}{\gamma+n},\, \gamma+n,\, \alpha+\frac{n}{2},\, \beta+\tfrac{1}{2} \sum_{i=1}^n (x_i - \bar{x})^2+\frac{n\gamma(\bar{x}-\lambda)^2}{2(n+\gamma)}, where  \bar{x} is the sample mean.
Multivariate normal with known covariance matrix μ (mean vector) Multivariate normal \mathbf{\mu}_0,\, \Sigma_0 \left(\Sigma_0^{-1} + n\Sigma^{-1}\right)^{-1}\left( \Sigma_0^{-1}\mu_0 + n \Sigma^{-1} \bar{x} \right),\, \left(\Sigma_0^{-1} + n\Sigma^{-1}\right)^{-1}, where \bar{x} is the sample mean.
Multivariate normal with known precision matrix μ (mean vector) Multivariate normal \mathbf{\mu}_0,\, \Lambda_0 \left(\Lambda_0 + n\Lambda\right)^{-1}\left( \Lambda_0\mu_0 + n \Lambda \bar{x} \right),\, \left(\Lambda_0 + n\Lambda\right), where \bar{x} is the sample mean.
Multivariate normal with known mean Σ (covariance matrix) Inverse-Wishart \kappa ,\, \Psi n+\kappa ,\, \Psi + \sum_{i=1}^n (x_i - \mu) (x_i - \mu)^T
Multivariate normal with known mean Λ (precision matrix) Wishart
Multivariate normal μ (mean vector) and Σ (covariance matrix) Normal-Inverse-Wishart distribution \lambda ,\, \nu ,\, \kappa ,\, \Psi \frac{n\bar{x}+\nu\lambda}{n+\nu} ,\, n+\nu,\, n+\kappa ,\, \Psi + \sum_{i=1}^n (x_i - \bar{x}) (x_i - \bar{x})^T + \frac{n\nu}{n+\nu}(\bar{x}-\lambda)(\bar{x}-\lambda)^T , where  \bar{x} is the sample mean
Multivariate normal μ (mean vector) and Λ (precision matrix) Normal-Wishart \kappa_0,\, \mathbf{\mu}_0,\, \nu_0,\, \Lambda_0 (\kappa_0 + n),\, \frac{\kappa_0}{\kappa_0 + n} \mathbf{\mu}_0 + \frac{n}{\kappa_0 + n} \bar{x},\, (\nu_0 + n),\, \left( \Lambda_0^{-1} + C + \frac{\kappa_0 n}{\kappa_0 + n} (\bar{x} - \mathbf{\mu}_0) (\bar{x} - \mathbf{\mu}_0)^T \right)^{-1} where \bar{x} is the sample mean and C = \sum_{i=1}^n (x_i - \bar{x}) (x_i - \bar{x})^T.
Pareto k (shape) Gamma \alpha,\, \beta\! \alpha+n,\, \beta+\sum_{i=1}^n \ln\frac{x_i}{x_{\mathrm{m}}}\!
Gamma
with known shape α
β (inverse scale) Gamma \alpha_0,\, \beta_0\! \alpha_0+n\alpha,\, \beta_0+\sum_{i=1}^n x_i\!
Inverse Gamma
with known shape α
β (inverse scale) Gamma \alpha_0,\, \beta_0\! \alpha_0+n\alpha,\, \beta_0+\sum_{i=1}^n \frac{1}{x_i}\!
Gamma [6] α (shape), β (inverse scale) \frac{1}{Z} \frac{p^{\alpha-1} e^{-\beta q}}{\Gamma(\alpha)^r \beta^{-\alpha s}} p,\, q,\, r,\, s \! p \prod_{i=1}^n x_i,\, q + \sum_{i=1}^n x_i,\, r + n,\, s + n \!

References

  1. ^ Howard Raiffa and Robert Schlaifer. Applied Statistical Decision Theory. Division of Research, Graduate School of Business Administration, Harvard University, 1961.
  2. ^ Jeff Miller et al. Earliest Known Uses of Some of the Words of Mathematics, "conjugate prior distributions". Electronic document, revision of November 13, 2005, retrieved December 2, 2005.
  3. ^ Andrew Gelman, John B. Carlin, Hal S. Stern, and Donald B. Rubin. Bayesian Data Analysis, 2nd edition. CRC Press, 2003. ISBN 1-58488-388-X.
  4. ^ a b c β is rate or inverse scale. In parameterization of Gamma distribution,θ = 1/β and k = α.
  5. ^ In terms of the Inverse Gamma, β is a Scale parameter
  6. ^ Fink, D. 1995 A Compendium of Conjugate Priors. In progress report: Extension and enhancement of methods for setting data quality objectives. (DOE contract 95‑831).

External links


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Prior probability — Bayesian statistics Theory Bayesian probability Probability interpretations Bayes theorem Bayes rule · Bayes factor Bayesian inference Bayesian network Prior · Posterior · Likelihood …   Wikipedia

  • Conjugate vaccine — A conjugate vaccine is created by covalently attaching a poor (polysaccharide organism) antigen to a carrier protein (preferably from the same microorganism), thereby conferring the immunological attributes of the carrier on the attached antigen …   Wikipedia

  • Pneumococcal conjugate vaccine — Pneumococcal polysaccharide vaccine Vaccine description Target disease Streptococcus pneumoniae Type Conjugate vaccine Clinical data AHFS/Drugs.com …   Wikipedia

  • Jeffreys prior — In Bayesian probability, the Jeffreys prior (called after Harold Jeffreys) is a non informative prior distribution proportional to the square rootof the Fisher information:: p( heta) propto sqrt{I( heta | y)}and is invariant under… …   Wikipedia

  • Bayes estimator — In decision theory and estimation theory, a Bayes estimator is an estimator or decision rule that maximizes the posterior expected value of a utility function or minimizes the posterior expected value of a loss function (also called posterior… …   Wikipedia

  • Exponential family — Not to be confused with the exponential distribution. Natural parameter links here. For the usage of this term in differential geometry, see differential geometry of curves. In probability and statistics, an exponential family is an important… …   Wikipedia

  • Dirichlet distribution — Several images of the probability density of the Dirichlet distribution when K=3 for various parameter vectors α. Clockwise from top left: α=(6, 2, 2), (3, 7, 5), (6, 2, 6), (2, 3, 4). In probability and… …   Wikipedia

  • Compound probability distribution — In probability theory, a compound probability distribution is the probability distribution that results from assuming that a random variable is distributed according to some parametrized distribution F with an unknown parameter θ that is… …   Wikipedia

  • One-shot learning — is an object categorization problem of current research interest in computer vision. Whereas most machine learning based object categorization algorithms require training on hundreds or thousands of images and very large datasets, one shot… …   Wikipedia

  • Empirical Bayes method — In statistics, empirical Bayes methods are a class of methods which use empirical data to evaluate / approximate the conditional probability distributions that arise from Bayes theorem. These methods allow one to estimate quantities… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”