Conjugate prior

From HandWiki

In Bayesian probability theory, if the posterior distribution p(θ | x) is in the same probability distribution 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 function p(x | θ).

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 give intuition, by more transparently showing 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.[1] A similar concept had been discovered independently by George Alfred Barnard.[2]

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 [math]\displaystyle{ s }[/math] in [math]\displaystyle{ n }[/math] Bernoulli trials with unknown probability of success [math]\displaystyle{ q }[/math] in [0,1]. This random variable will follow the binomial distribution, with a probability mass function of the form

[math]\displaystyle{ p(s) = {n \choose s}q^s (1-q)^{n-s} }[/math]

The usual conjugate prior is the beta distribution with parameters ([math]\displaystyle{ \alpha }[/math], [math]\displaystyle{ \beta }[/math]):

[math]\displaystyle{ p(q) = {q^{\alpha-1}(1-q)^{\beta-1} \over \Beta(\alpha,\beta)} }[/math]

where [math]\displaystyle{ \alpha }[/math] and [math]\displaystyle{ \beta }[/math] are chosen to reflect any existing belief or information ([math]\displaystyle{ \alpha }[/math] = 1 and [math]\displaystyle{ \beta }[/math] = 1 would give a uniform distribution) and Β([math]\displaystyle{ \alpha }[/math][math]\displaystyle{ \beta }[/math]) is the Beta function acting as a normalising constant.

In this context, [math]\displaystyle{ \alpha }[/math] and [math]\displaystyle{ \beta }[/math] 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 = n - s failures, we have

[math]\displaystyle{ \begin{align} P(s, f \mid q=x) &= {s+f \choose s} x^s(1-x)^f,\\ P(q=x) &= {x^{\alpha-1}(1-x)^{\beta-1} \over \Beta(\alpha,\beta)},\\ P(q=x \mid s,f) &= \frac{P(s, f \mid x)P(x)}{\int P(s, f \mid y)P(y)dy}\\ & = {{{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)}, \end{align} }[/math]

which is another Beta distribution with parameters ([math]\displaystyle{ \alpha }[/math] + s, [math]\displaystyle{ \beta }[/math] + 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.

Interpretations

Pseudo-observations

It is often useful to think of the hyperparameters of a conjugate prior distribution as corresponding to having observed a certain number of pseudo-observations with properties specified by the parameters. For example, the values [math]\displaystyle{ \alpha }[/math] and [math]\displaystyle{ \beta }[/math] of a beta distribution can be thought of as corresponding to [math]\displaystyle{ \alpha-1 }[/math] successes and [math]\displaystyle{ \beta-1 }[/math] failures if the posterior mode is used to choose an optimal parameter setting, or [math]\displaystyle{ \alpha }[/math] successes and [math]\displaystyle{ \beta }[/math] 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 both in providing an intuition behind the often messy update equations, as well as to help choose reasonable hyperparameters for a prior.


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. 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.

Over three days you look at the app and find the following number of cars within a short distance of your home address: [math]\displaystyle{ \mathbf{x} = [3,4,1] }[/math]

If we assume the data comes from a Poisson distribution, we can compute the maximum likelihood estimate of the parameters of the model which is [math]\displaystyle{ \lambda = \frac{3+4+1}{3} \approx 2.67. }[/math] Using this maximum likelihood estimate we can compute the probability that there will be at least one car available on a given day: [math]\displaystyle{ p(x\gt 0 | \lambda \approx 2.67) = 1 - p(x=0 | \lambda \approx 2.67) = 1-\frac{2.67^0 e^{-2.67}}{0!} \approx 0.93 }[/math]

This is the Poisson distribution that is the most likely to have generated the observed data [math]\displaystyle{ \mathbf{x} }[/math]. But the data could also have come from another Poisson distribution, e.g. one with [math]\displaystyle{ \lambda = 3 }[/math], or [math]\displaystyle{ \lambda = 2 }[/math], etc. In fact there is an infinite number of poisson distributions that could have generated the observed data and with relatively few data points we should be quite uncertain about which exact poisson distribution generated this data. Intuitively we should instead take a weighted average of the probability of [math]\displaystyle{ p(x\gt 0| \lambda) }[/math] for each of those Poisson distributions, weighted by how likely they each are, given the data we've observed [math]\displaystyle{ \mathbf{x} }[/math].

Generally, this quantity is known as the posterior predictive distribution [math]\displaystyle{ p(x|\mathbf{x}) = \int_\theta p(x|\theta)p(\theta|\mathbf{x})d\theta\,, }[/math] where [math]\displaystyle{ x }[/math] is a new data point, [math]\displaystyle{ \mathbf{x} }[/math] is the observed data and [math]\displaystyle{ \theta }[/math] are the parameters of the model. Using Bayes' theorem we can expand [math]\displaystyle{ p(\theta|\mathbf{x}) = \frac{p(\mathbf{x}|\theta)p(\theta)}{p(\mathbf{x})}\,, }[/math] therefore [math]\displaystyle{ p(x|\mathbf{x}) = \int_\theta p(x|\theta)\frac{p(\mathbf{x}|\theta)p(\theta)}{p(\mathbf{x})}d\theta\,. }[/math] Generally, this integral is hard to compute. However, if you choose a conjugate prior distribution [math]\displaystyle{ p(\theta) }[/math], 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 as can be seen from the last column in the table below. The Gamma distribution is parameterized by two hyperparameters [math]\displaystyle{ \alpha, \beta }[/math] which we have to choose. By looking at plots of the gamma distribution we pick [math]\displaystyle{ \alpha = \beta = 2 }[/math], 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.

Given the prior hyperparameters [math]\displaystyle{ \alpha }[/math] and [math]\displaystyle{ \beta }[/math] we can compute the posterior hyperparameters [math]\displaystyle{ \alpha' = \alpha + \sum_i x_i = 2 + 3+4+1 = 10 }[/math] and [math]\displaystyle{ \beta' = \beta + n = 2+3 = 5 }[/math]

Given the posterior hyperparameters we can finally compute the posterior predictive of [math]\displaystyle{ p(x\gt 0|\mathbf{x}) = 1-p(x=0|\mathbf{x}) = 1 - NB\left(0\, |\, 10, \frac{1}{1+5}\right) \approx 0.84 }[/math]

This much more conservative estimate reflect 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 points [math]\displaystyle{ x_1,\ldots,x_n }[/math] (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 likelihood function is a discrete distribution

Likelihood Model parameters Conjugate prior distribution Prior hyperparameters Posterior hyperparameters[note 1] Interpretation of hyperparameters Posterior predictive[note 2]
Bernoulli p (probability) Beta [math]\displaystyle{ \alpha,\, \beta\in\mathbb{R}\! }[/math] [math]\displaystyle{ \alpha + \sum_{i=1}^n x_i,\, \beta + n - \sum_{i=1}^n x_i\! }[/math] [math]\displaystyle{ \alpha }[/math] successes, [math]\displaystyle{ \beta }[/math] failures[note 3] [math]\displaystyle{ p(\tilde{x}=1) = \frac{\alpha'}{\alpha'+\beta'} }[/math]
Binomial p (probability) Beta [math]\displaystyle{ \alpha,\, \beta\in\mathbb{R}\! }[/math] [math]\displaystyle{ \alpha + \sum_{i=1}^n x_i,\, \beta + \sum_{i=1}^nN_i - \sum_{i=1}^n x_i\! }[/math] [math]\displaystyle{ \alpha }[/math] successes, [math]\displaystyle{ \beta }[/math] failures[note 3] [math]\displaystyle{ \operatorname{BetaBin}(\tilde{x}|\alpha',\beta') }[/math]
(beta-binomial)
Negative binomial
with known failure number, r
p (probability) Beta [math]\displaystyle{ \alpha,\, \beta\in\mathbb{R}\! }[/math] [math]\displaystyle{ \alpha + rn ,\, \beta + \sum_{i=1}^n x_i\! }[/math] [math]\displaystyle{ \alpha }[/math] total successes, [math]\displaystyle{ \beta }[/math] failures[note 3] (i.e., [math]\displaystyle{ \frac{\beta}{r} }[/math] experiments, assuming [math]\displaystyle{ r }[/math] stays fixed) [math]\displaystyle{ \operatorname{BetaNegBin}(\tilde{x}|\alpha',\beta') }[/math]

(beta-negative binomial)

Poisson λ (rate) Gamma [math]\displaystyle{ k,\, \theta\in\mathbb{R}\! }[/math] [math]\displaystyle{ k + \sum_{i=1}^n x_i,\ \frac {\theta} {n \theta + 1}\! }[/math] [math]\displaystyle{ k }[/math] total occurrences in [math]\displaystyle{ \frac{1}{\theta} }[/math] intervals [math]\displaystyle{ \operatorname{NB}\left(\tilde{x}\mid k', \frac{\theta'}{\theta'+1}\right) }[/math]
(negative binomial)
[math]\displaystyle{ \alpha,\, \beta\! }[/math] [note 4] [math]\displaystyle{ \alpha + \sum_{i=1}^n x_i ,\ \beta + n\! }[/math] [math]\displaystyle{ \alpha }[/math] total occurrences in [math]\displaystyle{ \beta }[/math] intervals [math]\displaystyle{ \operatorname{NB}\left(\tilde{x}\mid\alpha', \frac{1}{1 + \beta'}\right) }[/math]
(negative binomial)
Categorical p (probability vector), k (number of categories; i.e., size of p) Dirichlet [math]\displaystyle{ \boldsymbol\alpha\in\mathbb{R}^k\! }[/math] [math]\displaystyle{ \boldsymbol\alpha + (c_1, \ldots, c_k), }[/math] where [math]\displaystyle{ c_i }[/math] is the number of observations in category i [math]\displaystyle{ \alpha_i }[/math] occurrences of category [math]\displaystyle{ i }[/math][note 3] [math]\displaystyle{ \begin{align} p(\tilde{x}=i) &= \frac{{\alpha_i}'}{\sum_i {\alpha_i}'} \\ &= \frac{\alpha_i + c_i}{\sum_i \alpha_i + n} \end{align} }[/math]
Multinomial p (probability vector), k (number of categories; i.e., size of p) Dirichlet [math]\displaystyle{ \boldsymbol\alpha\in\mathbb{R}^k\! }[/math] [math]\displaystyle{ \boldsymbol\alpha + \sum_{i=1}^n\mathbf{x}_i\! }[/math] [math]\displaystyle{ \alpha_i }[/math] occurrences of category [math]\displaystyle{ i }[/math][note 3] [math]\displaystyle{ \operatorname{DirMult}(\tilde{\mathbf{x}}\mid\boldsymbol\alpha') }[/math]
(Dirichlet-multinomial)
Hypergeometric
with known total population size, N
M (number of target members) Beta-binomial[3] [math]\displaystyle{ n=N, \alpha,\, \beta\! }[/math] [math]\displaystyle{ \alpha + \sum_{i=1}^n x_i,\, \beta + \sum_{i=1}^nN_i - \sum_{i=1}^n x_i\! }[/math] [math]\displaystyle{ \alpha }[/math] successes, [math]\displaystyle{ \beta }[/math] failures[note 3]
Geometric p0 (probability) Beta [math]\displaystyle{ \alpha,\, \beta\in\mathbb{R}\! }[/math] [math]\displaystyle{ \alpha + n,\, \beta + \sum_{i=1}^n x_i\! }[/math] [math]\displaystyle{ \alpha }[/math] experiments, [math]\displaystyle{ \beta }[/math] total failures[note 3]

When likelihood function is a continuous distribution

Likelihood Model parameters Conjugate prior distribution Prior hyperparameters Posterior hyperparameters[note 1] Interpretation of hyperparameters Posterior predictive[note 5]
Normal
with known variance σ2
μ (mean) Normal [math]\displaystyle{ \mu_0,\, \sigma_0^2\! }[/math] [math]\displaystyle{ \frac{1}{\frac{1}{\sigma_0^2} + \frac{n}{\sigma^2}}\left(\frac{\mu_0}{\sigma_0^2} + \frac{\sum_{i=1}^n x_i}{\sigma^2}\right), \left(\frac{1}{\sigma_0^2} + \frac{n}{\sigma^2}\right)^{-1} }[/math] mean was estimated from observations with total precision (sum of all individual precisions)[math]\displaystyle{ 1/\sigma_0^2 }[/math] and with sample mean [math]\displaystyle{ \mu_0 }[/math] [math]\displaystyle{ \mathcal{N}(\tilde{x}|\mu_0', {\sigma_0^2}' +\sigma^2) }[/math][4]
Normal
with known precision τ
μ (mean) Normal [math]\displaystyle{ \mu_0,\, \tau_0^{-1}\! }[/math] [math]\displaystyle{ \frac{\tau_0 \mu_0 + \tau \sum_{i=1}^n x_i}{\tau_0 + n \tau},\, \left(\tau_0 + n \tau\right)^{-1} }[/math] mean was estimated from observations with total precision (sum of all individual precisions)[math]\displaystyle{ \tau_0 }[/math] and with sample mean [math]\displaystyle{ \mu_0 }[/math] [math]\displaystyle{ \mathcal{N}\left(\tilde{x}\mid\mu_0', \frac{1}{\tau_0'} +\frac{1}{\tau}\right) }[/math][4]
Normal
with known mean μ
σ2 (variance) Inverse gamma [math]\displaystyle{ \mathbf{\alpha,\, \beta} }[/math] [note 6] [math]\displaystyle{ \mathbf{\alpha}+\frac{n}{2},\, \mathbf{\beta} + \frac{\sum_{i=1}^n{(x_i-\mu)^2}}{2} }[/math] variance was estimated from [math]\displaystyle{ 2\alpha }[/math] observations with sample variance [math]\displaystyle{ \beta/\alpha }[/math] (i.e. with sum of squared deviations [math]\displaystyle{ 2\beta }[/math], where deviations are from known mean [math]\displaystyle{ \mu }[/math]) [math]\displaystyle{ t_{2\alpha'}(\tilde{x}|\mu,\sigma^2 = \beta'/\alpha') }[/math][4]
Normal
with known mean μ
σ2 (variance) Scaled inverse chi-squared [math]\displaystyle{ \nu,\, \sigma_0^2\! }[/math] [math]\displaystyle{ \nu+n,\, \frac{\nu\sigma_0^2 + \sum_{i=1}^n (x_i-\mu)^2}{\nu+n}\! }[/math] variance was estimated from [math]\displaystyle{ \nu }[/math] observations with sample variance [math]\displaystyle{ \sigma_0^2 }[/math] [math]\displaystyle{ t_{\nu'}(\tilde{x}|\mu,{\sigma_0^2}') }[/math][4]
Normal
with known mean μ
τ (precision) Gamma [math]\displaystyle{ \alpha,\, \beta\! }[/math][note 4] [math]\displaystyle{ \alpha + \frac{n}{2},\, \beta + \frac{\sum_{i=1}^n (x_i-\mu)^2}{2}\! }[/math] precision was estimated from [math]\displaystyle{ 2\alpha }[/math] observations with sample variance [math]\displaystyle{ \beta/\alpha }[/math] (i.e. with sum of squared deviations [math]\displaystyle{ 2\beta }[/math], where deviations are from known mean [math]\displaystyle{ \mu }[/math]) [math]\displaystyle{ t_{2\alpha'}(\tilde{x}\mid\mu,\sigma^2 = \beta'/\alpha') }[/math][4]
Normal[note 7] μ and σ2
Assuming exchangeability
Normal-inverse gamma [math]\displaystyle{ \mu_0 ,\, \nu ,\, \alpha ,\, \beta }[/math] [math]\displaystyle{ \frac{\nu\mu_0+n\bar{x}}{\nu+n} ,\, \nu+n,\, \alpha+\frac{n}{2} ,\, }[/math]
[math]\displaystyle{ \beta + \tfrac{1}{2} \sum_{i=1}^n (x_i - \bar{x})^2 + \frac{n\nu}{\nu+n}\frac{(\bar{x}-\mu_0)^2}{2} }[/math]
  • [math]\displaystyle{ \bar{x} }[/math] is the sample mean
mean was estimated from [math]\displaystyle{ \nu }[/math] observations with sample mean [math]\displaystyle{ \mu_0 }[/math]; variance was estimated from [math]\displaystyle{ 2\alpha }[/math] observations with sample mean [math]\displaystyle{ \mu_0 }[/math] and sum of squared deviations [math]\displaystyle{ 2\beta }[/math] [math]\displaystyle{ t_{2\alpha'}\left(\tilde{x}\mid\mu',\frac{\beta'(\nu'+1)}{\nu' \alpha'}\right) }[/math][4]
Normal μ and τ
Assuming exchangeability
Normal-gamma [math]\displaystyle{ \mu_0 ,\, \nu ,\, \alpha ,\, \beta }[/math] [math]\displaystyle{ \frac{\nu\mu_0+n\bar{x}}{\nu+n} ,\, \nu+n,\, \alpha+\frac{n}{2} ,\, }[/math]
[math]\displaystyle{ \beta + \tfrac{1}{2} \sum_{i=1}^n (x_i - \bar{x})^2 + \frac{n\nu}{\nu+n}\frac{(\bar{x}-\mu_0)^2}{2} }[/math]
  • [math]\displaystyle{ \bar{x} }[/math] is the sample mean
mean was estimated from [math]\displaystyle{ \nu }[/math] observations with sample mean [math]\displaystyle{ \mu_0 }[/math], and precision was estimated from [math]\displaystyle{ 2\alpha }[/math] observations with sample mean [math]\displaystyle{ \mu_0 }[/math] and sum of squared deviations [math]\displaystyle{ 2\beta }[/math] [math]\displaystyle{ t_{2\alpha'}\left(\tilde{x}\mid\mu',\frac{\beta'(\nu'+1)}{\alpha'\nu'}\right) }[/math][4]
Multivariate normal with known covariance matrix Σ μ (mean vector) Multivariate normal [math]\displaystyle{ \boldsymbol{\boldsymbol\mu}_0,\, \boldsymbol\Sigma_0 }[/math] [math]\displaystyle{ \left(\boldsymbol\Sigma_0^{-1} + n\boldsymbol\Sigma^{-1}\right)^{-1}\left( \boldsymbol\Sigma_0^{-1}\boldsymbol\mu_0 + n \boldsymbol\Sigma^{-1} \mathbf{\bar{x}} \right), }[/math]
[math]\displaystyle{ \left(\boldsymbol\Sigma_0^{-1} + n\boldsymbol\Sigma^{-1}\right)^{-1} }[/math]
  • [math]\displaystyle{ \mathbf{\bar{x}} }[/math] is the sample mean
mean was estimated from observations with total precision (sum of all individual precisions)[math]\displaystyle{ \boldsymbol\Sigma_0^{-1} }[/math] and with sample mean [math]\displaystyle{ \boldsymbol\mu_0 }[/math] [math]\displaystyle{ \mathcal{N}(\tilde{\mathbf{x}}\mid{\boldsymbol\mu_0}', {\boldsymbol\Sigma_0}' +\boldsymbol\Sigma) }[/math][4]
Multivariate normal with known precision matrix Λ μ (mean vector) Multivariate normal [math]\displaystyle{ \mathbf{\boldsymbol\mu}_0,\, \boldsymbol\Lambda_0 }[/math] [math]\displaystyle{ \left(\boldsymbol\Lambda_0 + n\boldsymbol\Lambda\right)^{-1}\left( \boldsymbol\Lambda_0\boldsymbol\mu_0 + n \boldsymbol\Lambda \mathbf{\bar{x}} \right),\, \left(\boldsymbol\Lambda_0 + n\boldsymbol\Lambda\right) }[/math]
  • [math]\displaystyle{ \mathbf{\bar{x}} }[/math] is the sample mean
mean was estimated from observations with total precision (sum of all individual precisions)[math]\displaystyle{ \boldsymbol\Lambda_0 }[/math] and with sample mean [math]\displaystyle{ \boldsymbol\mu_0 }[/math] [math]\displaystyle{ \mathcal{N}\left(\tilde{\mathbf{x}}\mid{\boldsymbol\mu_0}', {{\boldsymbol\Lambda_0}'}^{-1} + \boldsymbol\Lambda^{-1}\right) }[/math][4]
Multivariate normal with known mean μ Σ (covariance matrix) Inverse-Wishart [math]\displaystyle{ \nu ,\, \boldsymbol\Psi }[/math] [math]\displaystyle{ n+\nu ,\, \boldsymbol\Psi + \sum_{i=1}^n (\mathbf{x_i} - \boldsymbol\mu) (\mathbf{x_i} - \boldsymbol\mu)^T }[/math] covariance matrix was estimated from [math]\displaystyle{ \nu }[/math] observations with sum of pairwise deviation products [math]\displaystyle{ \boldsymbol\Psi }[/math] [math]\displaystyle{ t_{\nu'-p+1}\left(\tilde{\mathbf{x}}|\boldsymbol\mu,\frac{1}{\nu'-p+1}\boldsymbol\Psi'\right) }[/math][4]
Multivariate normal with known mean μ Λ (precision matrix) Wishart [math]\displaystyle{ \nu ,\, \mathbf{V} }[/math] [math]\displaystyle{ n+\nu ,\, \left(\mathbf{V}^{-1} + \sum_{i=1}^n (\mathbf{x_i} - \boldsymbol\mu) (\mathbf{x_i} - \boldsymbol\mu)^T\right)^{-1} }[/math] covariance matrix was estimated from [math]\displaystyle{ \nu }[/math] observations with sum of pairwise deviation products [math]\displaystyle{ \mathbf{V}^{-1} }[/math] [math]\displaystyle{ t_{\nu'-p+1}\left(\tilde{\mathbf{x}}\mid\boldsymbol\mu,\frac{1}{\nu'-p+1}{\mathbf{V}'}^{-1}\right) }[/math][4]
Multivariate normal μ (mean vector) and Σ (covariance matrix) normal-inverse-Wishart [math]\displaystyle{ \boldsymbol\mu_0 ,\, \kappa_0 ,\, \nu_0 ,\, \boldsymbol\Psi }[/math] [math]\displaystyle{ \frac{\kappa_0\boldsymbol\mu_0+n\mathbf{\bar{x}}}{\kappa_0+n} ,\, \kappa_0+n,\, \nu_0+n ,\, }[/math]
[math]\displaystyle{ \boldsymbol\Psi + \mathbf{C} + \frac{\kappa_0 n}{\kappa_0+n}(\mathbf{\bar{x}}-\boldsymbol\mu_0)(\mathbf{\bar{x}}-\boldsymbol\mu_0)^T }[/math]
  • [math]\displaystyle{ \mathbf{\bar{x}} }[/math] is the sample mean
  • [math]\displaystyle{ \mathbf{C} = \sum_{i=1}^n (\mathbf{x_i} - \mathbf{\bar{x}}) (\mathbf{x_i} - \mathbf{\bar{x}})^T }[/math]
mean was estimated from [math]\displaystyle{ \kappa_0 }[/math] observations with sample mean [math]\displaystyle{ \boldsymbol\mu_0 }[/math]; covariance matrix was estimated from [math]\displaystyle{ \nu_0 }[/math] observations with sample mean [math]\displaystyle{ \boldsymbol\mu_0 }[/math] and with sum of pairwise deviation products [math]\displaystyle{ \boldsymbol\Psi=\nu_0\boldsymbol\Sigma_0 }[/math] [math]\displaystyle{ t_{{\nu_0}'-p+1}\left(\tilde{\mathbf{x}}|{\boldsymbol\mu_0}',\frac{{\kappa_0}'+1}{{\kappa_0}'({\nu_0}'-p+1)}\boldsymbol\Psi'\right) }[/math][4]
Multivariate normal μ (mean vector) and Λ (precision matrix) normal-Wishart [math]\displaystyle{ \boldsymbol\mu_0 ,\, \kappa_0 ,\, \nu_0 ,\, \mathbf{V} }[/math] [math]\displaystyle{ \frac{\kappa_0\boldsymbol\mu_0+n\mathbf{\bar{x}}}{\kappa_0+n} ,\, \kappa_0+n,\, \nu_0+n ,\, }[/math]
[math]\displaystyle{ \left(\mathbf{V}^{-1} + \mathbf{C} + \frac{\kappa_0 n}{\kappa_0+n}(\mathbf{\bar{x}}-\boldsymbol\mu_0)(\mathbf{\bar{x}}-\boldsymbol\mu_0)^T\right)^{-1} }[/math]
  • [math]\displaystyle{ \mathbf{\bar{x}} }[/math] is the sample mean
  • [math]\displaystyle{ \mathbf{C} = \sum_{i=1}^n (\mathbf{x_i} - \mathbf{\bar{x}}) (\mathbf{x_i} - \mathbf{\bar{x}})^T }[/math]
mean was estimated from [math]\displaystyle{ \kappa_0 }[/math] observations with sample mean [math]\displaystyle{ \boldsymbol\mu_0 }[/math]; covariance matrix was estimated from [math]\displaystyle{ \nu_0 }[/math] observations with sample mean [math]\displaystyle{ \boldsymbol\mu_0 }[/math] and with sum of pairwise deviation products [math]\displaystyle{ \mathbf{V}^{-1} }[/math] [math]\displaystyle{ t_{{\nu_0}'-p+1}\left(\tilde{\mathbf{x}}\mid {\boldsymbol\mu_0}', \frac{{\kappa_0}'+1}{{\kappa_0}'({\nu_0}'-p+1)}{\mathbf{V}'}^{-1}\right) }[/math][4]
Uniform [math]\displaystyle{ U(0,\theta)\! }[/math] Pareto [math]\displaystyle{ x_{m},\, k\! }[/math] [math]\displaystyle{ \max\{\,x_1,\ldots,x_n,x_\mathrm{m}\},\, k+n\! }[/math] [math]\displaystyle{ k }[/math] observations with maximum value [math]\displaystyle{ x_m }[/math]
Pareto
with known minimum xm
k (shape) Gamma [math]\displaystyle{ \alpha,\, \beta\! }[/math] [math]\displaystyle{ \alpha+n,\, \beta+\sum_{i=1}^n \ln\frac{x_i}{x_{\mathrm{m}}}\! }[/math] [math]\displaystyle{ \alpha }[/math] observations with sum [math]\displaystyle{ \beta }[/math] of the order of magnitude of each observation (i.e. the logarithm of the ratio of each observation to the minimum [math]\displaystyle{ x_m }[/math])
Weibull
with known shape β
θ (scale) Inverse gamma[3] [math]\displaystyle{ a, b\! }[/math] [math]\displaystyle{ a+n,\, b+\sum_{i=1}^n x_i^{\beta}\! }[/math] [math]\displaystyle{ a }[/math] observations with sum [math]\displaystyle{ b }[/math] of the β'th power of each observation
Log-normal Same as for the normal distribution after applying the natural logarithm to the data for the posterior hyperparameters. Please refer to (Fink 1997) to see the details.
Exponential λ (rate) Gamma [math]\displaystyle{ \alpha,\, \beta\! }[/math] [note 4] [math]\displaystyle{ \alpha+n,\, \beta+\sum_{i=1}^n x_i\! }[/math] [math]\displaystyle{ \alpha-1 }[/math] observations that sum to [math]\displaystyle{ \beta }[/math] [5] [math]\displaystyle{ \operatorname{Lomax}(\tilde{x}\mid\beta',\alpha') }[/math]
(Lomax distribution)
Gamma
with known shape α
β (rate) Gamma [math]\displaystyle{ \alpha_0,\, \beta_0\! }[/math] [math]\displaystyle{ \alpha_0+n\alpha,\, \beta_0+\sum_{i=1}^n x_i\! }[/math] [math]\displaystyle{ \alpha_0/\alpha }[/math] observations with sum [math]\displaystyle{ \beta_0 }[/math] [math]\displaystyle{ \operatorname{CG}(\tilde{\mathbf{x}}\mid\alpha,{\alpha_0}',{\beta_0}')=\operatorname{\beta'}(\tilde{\mathbf{x}}|\alpha,{\alpha_0}',1,{\beta_0}') }[/math] [note 8]
Inverse Gamma
with known shape α
β (inverse scale) Gamma [math]\displaystyle{ \alpha_0,\, \beta_0\! }[/math] [math]\displaystyle{ \alpha_0+n\alpha,\, \beta_0+\sum_{i=1}^n \frac{1}{x_i}\! }[/math] [math]\displaystyle{ \alpha_0/\alpha }[/math] observations with sum [math]\displaystyle{ \beta_0 }[/math]
Gamma
with known rate β
α (shape) [math]\displaystyle{ \propto \frac{a^{\alpha-1} \beta^{\alpha c}}{\Gamma(\alpha)^b} }[/math] [math]\displaystyle{ a,\, b,\, c\! }[/math] [math]\displaystyle{ a \prod_{i=1}^n x_i,\, b + n,\, c + n\! }[/math] [math]\displaystyle{ b }[/math] or [math]\displaystyle{ c }[/math] observations ([math]\displaystyle{ b }[/math] for estimating [math]\displaystyle{ \alpha }[/math], [math]\displaystyle{ c }[/math] for estimating [math]\displaystyle{ \beta }[/math]) with product [math]\displaystyle{ a }[/math]
Gamma[3] α (shape), β (inverse scale) [math]\displaystyle{ \propto \frac{p^{\alpha-1} e^{-\beta q}}{\Gamma(\alpha)^r \beta^{-\alpha s}} }[/math] [math]\displaystyle{ p,\, q,\, r,\, s \! }[/math] [math]\displaystyle{ p \prod_{i=1}^n x_i,\, q + \sum_{i=1}^n x_i,\, r + n,\, s + n \! }[/math] [math]\displaystyle{ \alpha }[/math] was estimated from [math]\displaystyle{ r }[/math] observations with product [math]\displaystyle{ p }[/math]; [math]\displaystyle{ \beta }[/math] was estimated from [math]\displaystyle{ s }[/math] observations with sum [math]\displaystyle{ q }[/math]
Beta α, β [math]\displaystyle{ \propto \frac{\Gamma(\alpha+\beta)^k \, p^\alpha \, q^\beta}{\Gamma(\alpha)^k\,\Gamma(\beta)^k} }[/math] [math]\displaystyle{ p,\, q,\, k \! }[/math] [math]\displaystyle{ p \prod_{i=1}^n x_i,\, q \prod_{i=1}^n (1-x_i),\, k + n \! }[/math] [math]\displaystyle{ \alpha }[/math] and [math]\displaystyle{ \beta }[/math] were estimated from [math]\displaystyle{ k }[/math] observations with product [math]\displaystyle{ p }[/math] and product of the complements [math]\displaystyle{ q }[/math]

See also

Notes

  1. 1.0 1.1 Denoted by the same symbols as the prior hyperparameters with primes added ('). For instance [math]\displaystyle{ \alpha }[/math] is denoted [math]\displaystyle{ \alpha' }[/math]
  2. This is the posterior predictive distribution of a new data point [math]\displaystyle{ \tilde{x} }[/math] given the observed data points, with the parameters marginalized out. Variables with primes indicate the posterior values of the parameters.
  3. 3.0 3.1 3.2 3.3 3.4 3.5 3.6 The exact interpretation of the parameters of a beta distribution in terms of number of successes and failures depends on what function is used to extract a point estimate from the distribution. The mean of a beta distribution is [math]\displaystyle{ \frac{\alpha}{\alpha + \beta}, }[/math] which corresponds to [math]\displaystyle{ \alpha }[/math] successes and [math]\displaystyle{ \beta }[/math] failures, while the mode is [math]\displaystyle{ \frac{\alpha - 1}{\alpha + \beta - 2}, }[/math] which corresponds to [math]\displaystyle{ \alpha - 1 }[/math] successes and [math]\displaystyle{ \beta - 1 }[/math] failures. Bayesians generally prefer to use the posterior mean rather than the posterior mode as a point estimate, justified by a quadratic loss function, and the use of [math]\displaystyle{ \alpha }[/math] and [math]\displaystyle{ \beta }[/math] is more convenient mathematically, while the use of [math]\displaystyle{ \alpha - 1 }[/math] and [math]\displaystyle{ \beta - 1 }[/math] has the advantage that a uniform [math]\displaystyle{ {\rm Beta}(1,1) }[/math] prior corresponds to 0 successes and 0 failures. The same issues apply to the Dirichlet distribution.
  4. 4.0 4.1 4.2 β is rate or inverse scale. In parameterization of gamma distribution,θ = 1/β and k = α.
  5. This is the posterior predictive distribution of a new data point [math]\displaystyle{ \tilde{x} }[/math] given the observed data points, with the parameters marginalized out. Variables with primes indicate the posterior values of the parameters. [math]\displaystyle{ \mathcal{N} }[/math] and [math]\displaystyle{ t_n }[/math] refer to the normal distribution and Student's t-distribution, respectively, or to the multivariate normal distribution and multivariate t-distribution in the multivariate cases.
  6. In terms of the inverse gamma, [math]\displaystyle{ \beta }[/math] is a scale parameter
  7. A different conjugate prior for unknown mean and variance, but with a fixed, linear relationship between them, is found in the normal variance-mean mixture, with the generalized inverse Gaussian as conjugate mixing distribution.
  8. [math]\displaystyle{ \operatorname{CG}() }[/math] is a compound gamma distribution; [math]\displaystyle{ \operatorname{\beta'}() }[/math] here is a generalized beta prime distribution.

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. 3.0 3.1 3.2 Fink, Daniel (1997). "A Compendium of Conjugate Priors". https://courses.physics.ucsd.edu/2018/Fall/physics210b/REFERENCES/conjugate_priors.pdf. 
  4. 4.00 4.01 4.02 4.03 4.04 4.05 4.06 4.07 4.08 4.09 4.10 4.11 4.12 Murphy, Kevin P. (2007), Conjugate Bayesian analysis of the Gaussian distribution, http://www.cs.ubc.ca/~murphyk/Papers/bayesGauss.pdf 
  5. Liu, Han; Wasserman, Larry (2014). Statistical Machine Learning. p. 314. https://www.stat.cmu.edu/~larry/=sml/Bayes.pdf#page=16.