Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Conjugate prior
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Concept in probability theory}} {{Bayesian statistics}} In [[Bayesian probability]] theory, if, given a [[likelihood function]] <math>p(x \mid \theta)</math>, the [[posterior probability|posterior distribution]] <math>p(\theta \mid x)</math> is in the same [[List of probability distributions|probability distribution family]] as the [[prior probability distribution]] <math>p(\theta)</math>, the prior and posterior are then called '''conjugate distributions''' with respect to that likelihood function and the prior is called a '''conjugate prior''' for the likelihood function <math>p(x \mid \theta)</math>. 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]].<ref name="raiffa_schlaifer">[[Howard Raiffa]] and [[Robert Schlaifer]]. ''Applied Statistical Decision Theory''. Division of Research, Graduate School of Business Administration, Harvard University, 1961.</ref> A similar concept had been discovered independently by [[George Alfred Barnard]].<ref name="miller">Jeff Miller et al. [http://jeff560.tripod.com/mathword.html Earliest Known Uses of Some of the Words of Mathematics], [http://jeff560.tripod.com/c.html "conjugate prior distributions"]. Electronic document, revision of November 13, 2005, retrieved December 2, 2005.</ref> == Example == The form of the conjugate prior can generally be determined by inspection of the [[probability density function|probability density]] or [[probability mass function]] of a distribution. For example, consider a [[random variable]] which consists of the number of successes <math>s</math> in <math>n</math> [[Bernoulli trial]]s with ''unknown'' probability of success <math>q</math> in [0,1]. This random variable will follow the [[binomial distribution]], with a probability mass function of the form :<math>p(s) = {n \choose s}q^s (1-q)^{n-s}</math> The usual conjugate prior is the [[beta distribution]] with parameters (<math>\alpha</math>, <math>\beta</math>): :<math>p(q) = {q^{\alpha-1}(1-q)^{\beta-1} \over \Beta(\alpha,\beta)}</math> where <math>\alpha</math> and <math>\beta</math> are chosen to reflect any existing belief or information (<math>\alpha=1</math> and <math>\beta=1</math> would give a [[uniform distribution (continuous)|uniform distribution]]) and <math>\Beta(\alpha,\beta)</math> is the [[Beta function]] acting as a [[normalising constant]]. In this context, <math>\alpha</math> and <math>\beta</math> are called ''[[Hyperparameter (Bayesian statistics)|hyperparameter]]s'' (parameters of the prior), to distinguish them from parameters of the underlying model (here <math>q</math>). 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 <math>s</math> successes and <math>f = n - s</math> failures, then we have :<math>\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>(\alpha + s, \beta + f)</math>. 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'' with properties specified by the parameters. For example, the values <math>\alpha</math> and <math>\beta</math> of a [[beta distribution]] can be thought of as corresponding to <math>\alpha-1</math> successes and <math>\beta-1</math> failures if the posterior mode is used to choose an optimal parameter setting, or <math>\alpha</math> successes and <math>\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 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. Over three days you look at the app and find the following number of cars within a short distance of your home address: <math>\mathbf{x} = [3,4,1]</math> Suppose we assume the data comes from a [[Poisson distribution]]. In that case, we can compute the [[Maximum likelihood estimation|maximum likelihood]] estimate of the parameters of the model, which is <math display="inline">\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 display="inline">p(x>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>\mathbf{x}</math>. But the data could also have come from another Poisson distribution, e.g., one with <math>\lambda = 3</math>, or <math>\lambda = 2</math>, etc. In fact, there is an infinite number of Poisson distributions that ''could'' have generated the observed data. 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>p(x>0| \lambda)</math> for each of those Poisson distributions, weighted by how likely they each are, given the data we've observed <math>\mathbf{x}</math>. Generally, this quantity is known as the [[posterior predictive distribution]] <math>p(x|\mathbf{x}) = \int_\theta p(x|\theta)p(\theta|\mathbf{x})d\theta\,,</math> where <math>x</math> is a new data point, <math>\mathbf{x}</math> is the observed data and <math>\theta</math> are the parameters of the model. Using [[Bayes' theorem]] we can expand <math>p(\theta|\mathbf{x}) = \frac{p(\mathbf{x}|\theta)p(\theta)}{p(\mathbf{x})}\,,</math> therefore <math>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>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 table below. The Gamma distribution is parameterized by two hyperparameters <math>\alpha, \beta</math>, which we have to choose. By looking at plots of the gamma distribution, we pick <math>\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>\alpha</math> and <math>\beta</math> we can compute the posterior hyperparameters <math display="inline">\alpha' = \alpha + \sum_i x_i = 2 + 3+4+1 = 10</math> and <math display="inline">\beta' = \beta + n = 2+3 = 5</math> Given the posterior hyperparameters, we can finally compute the posterior predictive of <math display="inline">p(x>0|\mathbf{x}) = 1-p(x=0|\mathbf{x}) = 1 - NB\left(0\, |\, 10, \frac{5}{1+5}\right) \approx 0.84</math> 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'' points <math>x_1,\ldots,x_n</math> (which will be [[random vector]]s 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#Bayesian estimation: conjugate distributions|Exponential family: Conjugate distributions]]. === When the likelihood function is a discrete distribution === {{More citations needed section|date=August 2020}} {| class="wikitable" ! Likelihood <br> <math>p(x_i|\theta)</math>!! Model parameters <br> <math>\theta</math>!! Conjugate prior (and posterior) distribution <br> <math>p(\theta|\Theta), p(\theta|\mathbf{x},\Theta) = p(\theta|\Theta') </math>!! Prior hyperparameters <br><math>\Theta</math>!! Posterior hyperparameters<ref group=note name="posterior-hyperparameters"/> <br><math>\Theta'</math> !!Interpretation of hyperparameters!! Posterior predictive<ref group=note name=postpred/> <br><math>p(\tilde{x}|\mathbf{x}, \Theta) = p(\tilde{x}|\Theta')</math> |- | [[Bernoulli distribution|Bernoulli]] || ''p'' (probability) || [[Beta distribution|Beta]] || <math>\alpha,\, \beta\in\mathbb{R}\!</math> || <math>\alpha + \sum_{i=1}^n x_i,\, \beta + n - \sum_{i=1}^n x_i\!</math> | <math>\alpha</math> successes, <math>\beta</math> failures<ref group=note name="beta-interp"/> | <math>p(\tilde{x}=1) = \frac{\alpha'}{\alpha'+\beta'}</math><br>([[Bernoulli distribution|Bernoulli]]) |- | [[binomial distribution|Binomial]]<br />with known number of trials, ''m'' || ''p'' (probability) || [[Beta distribution|Beta]] || <math>\alpha,\, \beta\in\mathbb{R}\!</math> || <math>\alpha + \sum_{i=1}^n x_i,\, \beta + \sum_{i=1}^nN_i - \sum_{i=1}^n x_i\!</math> | <math>\alpha</math> successes, <math>\beta</math> failures<ref group=note name="beta-interp"/> | <math>\operatorname{BetaBin}(\tilde{x}|\alpha',\beta')</math><br />([[beta-binomial distribution|beta-binomial]]) |- | [[negative binomial distribution|Negative binomial]]<br />with known failure number, ''r'' || ''p'' (probability) || [[Beta distribution|Beta]] || <math>\alpha,\, \beta\in\mathbb{R}\!</math> || <math>\alpha + rn ,\, \beta + \sum_{i=1}^n x_i\!</math> | <math>\alpha</math> total successes, <math>\beta</math> failures<ref group=note name="beta-interp"/> (i.e., <math>\frac{\beta}{r}</math> experiments, assuming <math>r</math> stays fixed) |<math>\operatorname{BetaNegBin}(\tilde{x}|\alpha',\beta')</math> [[Beta negative binomial distribution|(beta-negative binomial)]] |- | rowspan=2 | [[Poisson distribution|Poisson]] | rowspan=2 | ''λ'' (rate) | rowspan=2 | [[Gamma distribution|Gamma]] | <math>k,\, \theta\in\mathbb{R}\!</math> || <math>k + \sum_{i=1}^n x_i,\ \frac {\theta} {n \theta + 1}\!</math> | <math>k</math> total occurrences in <math>\frac{1}{\theta}</math> intervals | <math>\operatorname{NB}\left(\tilde{x}\mid k', \frac{1}{\theta'+1}\right)</math><br />([[negative binomial distribution|negative binomial]]) |- | <math>\alpha,\, \beta\!</math> <ref group=note name="beta_rate"/> || <math>\alpha + \sum_{i=1}^n x_i ,\ \beta + n\!</math> | <math>\alpha</math> total occurrences in <math>\beta</math> intervals | <math>\operatorname{NB}\left(\tilde{x}\mid\alpha', \frac{\beta'}{1 + \beta'}\right)</math><br />([[negative binomial distribution|negative binomial]]) |- | [[categorical distribution|Categorical]] || '''''p''''' (probability vector), ''k'' (number of categories; i.e., size of '''''p''''') || [[Dirichlet distribution|Dirichlet]] || <math>\boldsymbol\alpha\in\mathbb{R}^k\!</math> || <math>\boldsymbol\alpha + (c_1, \ldots, c_k),</math> where <math>c_i</math> is the number of observations in category ''i'' | <math>\alpha_i</math> occurrences of category <math>i</math><ref group=note name="beta-interp"/> | <math>\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><br>([[categorical distribution|categorical]]) |- | [[multinomial distribution|Multinomial]] || '''''p''''' (probability vector), ''k'' (number of categories; i.e., size of '''''p''''') || [[Dirichlet distribution|Dirichlet]] || <math>\boldsymbol\alpha\in\mathbb{R}^k\!</math> || <math>\boldsymbol\alpha + \sum_{i=1}^n\mathbf{x}_i\!</math> | <math>\alpha_i</math> occurrences of category <math>i</math><ref group=note name="beta-interp"/> | <math>\operatorname{DirMult}(\tilde{\mathbf{x}}\mid\boldsymbol\alpha')</math><br />([[Dirichlet-multinomial distribution|Dirichlet-multinomial]]) |- | [[hypergeometric distribution|Hypergeometric]]<br />with known total population size, ''N'' || ''M'' (number of target members) || [[Beta-binomial distribution|Beta-binomial]]<ref name="Fink"/> || <math>n=N, \alpha,\, \beta\!</math> || <math>\alpha + \sum_{i=1}^n x_i,\, \beta + \sum_{i=1}^nN_i - \sum_{i=1}^n x_i\!</math> | <math>\alpha</math> successes, <math>\beta</math> failures<ref group=note name="beta-interp"/> | |- | [[geometric distribution|Geometric]] || ''p<sub>0</sub>'' (probability) || [[Beta distribution|Beta]] || <math>\alpha,\, \beta\in\mathbb{R}\!</math> || <math>\alpha + n,\, \beta + \sum_{i=1}^n x_i\!</math> | <math>\alpha</math> experiments, <math>\beta</math> total failures<ref group=note name="beta-interp"/> | |} === When likelihood function is a continuous distribution === {| class="wikitable" ! Likelihood <br> <math>p(x_i|\theta)</math>!! Model parameters <br> <math>\theta</math>!! Conjugate prior (and posterior) distribution <math>p(\theta|\Theta), p(\theta|\mathbf{x},\Theta) = p(\theta|\Theta') </math>!! Prior hyperparameters <br><math>\Theta</math>!! Posterior hyperparameters<ref name="posterior-hyperparameters" group="note" /><br><math>\Theta'</math>!!Interpretation of hyperparameters!!Posterior predictive<ref name="ppredNt" group="note" /><br><math>p(\tilde{x}|\mathbf{x}, \Theta) = p(\tilde{x}|\Theta')</math> |- | [[normal distribution|Normal]]<br>with known variance ''σ''<sup>2</sup> || ''μ'' (mean) || [[normal distribution|Normal]] || <math>\mu_0,\, \sigma_0^2\!</math>|| <math>\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>1/\sigma_0^2</math> and with sample mean <math>\mu_0</math> | <math>\mathcal{N}(\tilde{x}|\mu_0', {\sigma_0^2}' +\sigma^2)</math><ref name="murphy">{{citation |last=Murphy |first=Kevin P. |title=Conjugate Bayesian analysis of the Gaussian distribution |url=http://www.cs.ubc.ca/~murphyk/Papers/bayesGauss.pdf |year=2007}}</ref> |- | [[normal distribution|Normal]]<br>with known precision ''τ'' || ''μ'' (mean) || [[normal distribution|Normal]] || <math>\mu_0,\, \tau_0^{-1}\!</math>|| <math> \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>\tau_0</math> and with sample mean <math>\mu_0</math> | <math>\mathcal{N}\left(\tilde{x}\mid\mu_0', \frac{1}{\tau_0'} +\frac{1}{\tau}\right)</math><ref name="murphy" /> |- | [[Normal distribution|Normal]]<br>with known mean ''μ'' || ''σ''<sup>2</sup> (variance) || [[Inverse gamma distribution|Inverse gamma]] || <math> \mathbf{\alpha,\, \beta} </math> <ref name="beta_scale" group="note" />|| <math> \mathbf{\alpha}+\frac{n}{2},\, \mathbf{\beta} + \frac{\sum_{i=1}^n{(x_i-\mu)^2}}{2} </math> | variance was estimated from <math>2\alpha</math> observations with sample variance <math>\beta/\alpha</math> (i.e. with sum of [[squared deviations]] <math>2\beta</math>, where deviations are from known mean <math>\mu</math>) | <math>t_{2\alpha'}(\tilde{x}|\mu,\sigma^2 = \beta'/\alpha')</math><ref name="murphy" /> |- | [[normal distribution|Normal]]<br>with known mean ''μ'' || ''σ''<sup>2</sup> (variance) || [[Scaled inverse chi-squared distribution|Scaled inverse chi-squared]] || <math>\nu,\, \sigma_0^2\!</math>|| <math>\nu+n,\, \frac{\nu\sigma_0^2 + \sum_{i=1}^n (x_i-\mu)^2}{\nu+n}\!</math> | variance was estimated from <math>\nu</math> observations with sample variance <math>\sigma_0^2</math> | <math>t_{\nu'}(\tilde{x}|\mu,{\sigma_0^2}')</math><ref name="murphy" /> |- | [[normal distribution|Normal]]<br>with known mean ''μ'' || ''τ'' (precision) || [[Gamma distribution|Gamma]] || <math>\alpha,\, \beta\!</math> <ref name="beta_rate" group="note" />|| <math>\alpha + \frac{n}{2},\, \beta + \frac{\sum_{i=1}^n (x_i-\mu)^2}{2}\!</math> | precision was estimated from <math>2\alpha</math> observations with sample variance <math>\beta/\alpha</math> (i.e. with sum of [[squared deviations]] <math>2\beta</math>, where deviations are from known mean <math>\mu</math>) | <math>t_{2\alpha'}(\tilde{x}\mid\mu,\sigma^2 = \beta'/\alpha')</math><ref name="murphy" /> |- | [[Normal distribution|Normal]]<ref group="note">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 distribution|generalized inverse Gaussian]] as conjugate mixing distribution.</ref>|| ''μ'' and ''σ<sup>2</sup>''<br>Assuming [[Exchangeable random variables|exchangeability]]|| [[Normal-inverse gamma distribution|Normal-inverse gamma]] | <math> \mu_0 ,\, \nu ,\, \alpha ,\, \beta</math>|| <math>\frac{\nu\mu_0+n\bar{x}}{\nu+n} ,\, \nu+n,\, \alpha+\frac{n}{2} ,\, </math><br/><math> \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> \bar{x} </math> is the sample mean | mean was estimated from <math>\nu</math> observations with sample mean <math>\mu_0</math>; variance was estimated from <math>2\alpha</math> observations with sample mean <math>\mu_0</math> and sum of [[squared deviations]] <math>2\beta</math> | <math>t_{2\alpha'}\left(\tilde{x}\mid\mu',\frac{\beta'(\nu'+1)}{\nu' \alpha'}\right)</math><ref name="murphy" /> |- | [[Normal distribution|Normal]] || ''μ'' and ''τ''<br>Assuming [[Exchangeable random variables|exchangeability]]|| [[Normal-gamma distribution|Normal-gamma]] | <math> \mu_0 ,\, \nu ,\, \alpha ,\, \beta</math>|| <math>\frac{\nu\mu_0+n\bar{x}}{\nu+n} ,\, \nu+n,\, \alpha+\frac{n}{2} ,\, </math><br/><math> \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> \bar{x} </math> is the sample mean | mean was estimated from <math>\nu</math> observations with sample mean <math>\mu_0</math>, and precision was estimated from <math>2\alpha</math> observations with sample mean <math>\mu_0</math> and sum of [[squared deviations]] <math>2\beta</math> | <math>t_{2\alpha'}\left(\tilde{x}\mid\mu',\frac{\beta'(\nu'+1)}{\alpha'\nu'}\right)</math><ref name="murphy" /> |- | [[multivariate normal distribution|Multivariate normal]] with known covariance matrix '''''Σ''''' || '''''μ''''' (mean vector) || [[multivariate normal distribution|Multivariate normal]] || <math>\boldsymbol{\boldsymbol\mu}_0,\, \boldsymbol\Sigma_0</math>|| <math>\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><br/><math>\left(\boldsymbol\Sigma_0^{-1} + n\boldsymbol\Sigma^{-1}\right)^{-1}</math> *<math>\mathbf{\bar{x}}</math> is the sample mean | mean was estimated from observations with total precision (sum of all individual precisions)<math>\boldsymbol\Sigma_0^{-1}</math> and with sample mean <math>\boldsymbol\mu_0</math> | <math>\mathcal{N}(\tilde{\mathbf{x}}\mid{\boldsymbol\mu_0}', {\boldsymbol\Sigma_0}' +\boldsymbol\Sigma)</math><ref name="murphy" /> |- | [[multivariate normal distribution|Multivariate normal]] with known precision matrix '''''Λ''''' || '''''μ''''' (mean vector) || [[multivariate normal distribution|Multivariate normal]] || <math>\mathbf{\boldsymbol\mu}_0,\, \boldsymbol\Lambda_0</math>|| <math>\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>\mathbf{\bar{x}}</math> is the sample mean | mean was estimated from observations with total precision (sum of all individual precisions)<math>\boldsymbol\Lambda_0</math> and with sample mean <math>\boldsymbol\mu_0</math> | <math>\mathcal{N}\left(\tilde{\mathbf{x}}\mid{\boldsymbol\mu_0}', {{\boldsymbol\Lambda_0}'}^{-1} + \boldsymbol\Lambda^{-1}\right)</math><ref name="murphy" /> |- | [[multivariate normal distribution|Multivariate normal]] with known mean '''''μ''''' || '''''Σ''''' (covariance matrix) || [[Inverse-Wishart distribution|Inverse-Wishart]] || <math>\nu ,\, \boldsymbol\Psi</math>|| <math>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>\nu</math> observations with sum of pairwise deviation products <math>\boldsymbol\Psi</math> | <math>t_{\nu'-p+1}\left(\tilde{\mathbf{x}}|\boldsymbol\mu,\frac{1}{\nu'-p+1}\boldsymbol\Psi'\right)</math><ref name="murphy" /> |- | [[multivariate normal distribution|Multivariate normal]] with known mean '''''μ''''' || '''''Λ''''' (precision matrix) || [[Wishart distribution|Wishart]] || <math>\nu ,\, \mathbf{V}</math>|| <math>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>\nu</math> observations with sum of pairwise deviation products <math>\mathbf{V}^{-1}</math> | <math>t_{\nu'-p+1}\left(\tilde{\mathbf{x}}\mid\boldsymbol\mu,\frac{1}{\nu'-p+1}{\mathbf{V}'}^{-1}\right)</math><ref name="murphy" /> |- | [[multivariate normal distribution|Multivariate normal]] || '''''μ''''' (mean vector) and '''''Σ''''' (covariance matrix) || [[normal-inverse-Wishart distribution|normal-inverse-Wishart]] || <math>\boldsymbol\mu_0 ,\, \kappa_0 ,\, \nu_0 ,\, \boldsymbol\Psi</math>|| <math>\frac{\kappa_0\boldsymbol\mu_0+n\mathbf{\bar{x}}}{\kappa_0+n} ,\, \kappa_0+n,\, \nu_0+n ,\,</math><br/><math> \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> \mathbf{\bar{x}} </math> is the sample mean *<math>\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>\kappa_0</math> observations with sample mean <math>\boldsymbol\mu_0</math>; covariance matrix was estimated from <math>\nu_0</math> observations with sample mean <math>\boldsymbol\mu_0</math> and with sum of pairwise deviation products <math>\boldsymbol\Psi=\nu_0\boldsymbol\Sigma_0</math> | <math>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><ref name="murphy" /> |- | [[multivariate normal distribution|Multivariate normal]] || '''''μ''''' (mean vector) and '''''Λ''''' (precision matrix)|| [[normal-Wishart distribution|normal-Wishart]] || <math>\boldsymbol\mu_0 ,\, \kappa_0 ,\, \nu_0 ,\, \mathbf{V}</math>|| <math>\frac{\kappa_0\boldsymbol\mu_0+n\mathbf{\bar{x}}}{\kappa_0+n} ,\, \kappa_0+n,\, \nu_0+n ,\,</math><br/><math> \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> \mathbf{\bar{x}} </math> is the sample mean *<math>\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>\kappa_0</math> observations with sample mean <math>\boldsymbol\mu_0</math>; covariance matrix was estimated from <math>\nu_0</math> observations with sample mean <math>\boldsymbol\mu_0</math> and with sum of pairwise deviation products <math>\mathbf{V}^{-1}</math> | <math>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><ref name="murphy" /> |- | [[Uniform distribution (continuous)|Uniform]] || <math> U(0,\theta)\!</math>|| [[Pareto distribution|Pareto]] || <math> x_{m},\, k\!</math>|| <math> \max\{\,x_1,\ldots,x_n,x_\mathrm{m}\},\, k+n\!</math> | <math>k</math> observations with maximum value <math>x_m</math> | |- | [[Pareto distribution|Pareto]] <br/>with known minimum ''x''<sub>''m''</sub> || ''k'' (shape) || [[Gamma distribution|Gamma]] || <math>\alpha,\, \beta\!</math>|| <math>\alpha+n,\, \beta+\sum_{i=1}^n \ln\frac{x_i}{x_{\mathrm{m}}}\!</math> | <math>\alpha</math> observations with sum <math>\beta</math> of the [[order of magnitude]] of each observation (i.e. the logarithm of the ratio of each observation to the minimum <math>x_m</math>) | |- | [[Weibull distribution|Weibull]] <br/>with known shape ''β'' || ''θ'' (scale) || [[inverse-gamma distribution|Inverse gamma]]<ref name="Fink" />|| <math>a, b\!</math>|| <math>a+n,\, b+\sum_{i=1}^n x_i^{\beta}\!</math> | <math>a</math> observations with sum <math>b</math> of the ''β'''th power of each observation | |- | [[log-normal distribution|Log-normal]] | colspan="6" | Same as for the normal distribution after applying the natural logarithm to the data for the posterior hyperparameters. Please refer to {{harvtxt|Fink|1997|pp=21–22}} to see the details. |- | [[exponential distribution|Exponential]] || ''λ'' (rate) || [[Gamma distribution|Gamma]] || <math>\alpha,\, \beta\!</math> <ref name="beta_rate" group="note" />|| <math>\alpha+n,\, \beta+\sum_{i=1}^n x_i\!</math> | <math>\alpha</math> observations that sum to <math>\beta</math> <ref>{{cite book |last1=Liu |first1=Han |url=https://www.stat.cmu.edu/~larry/=sml/Bayes.pdf#page=16 |title=Statistical Machine Learning |last2=Wasserman |first2=Larry |year=2014 |page=314}}</ref> | <math>\operatorname{Lomax}(\tilde{x}\mid\beta',\alpha')</math><br />([[Lomax distribution]]) |- | [[Gamma Distribution|Gamma]] <br>with known shape ''α''|| ''β'' (rate) || [[Gamma Distribution|Gamma]] || <math>\alpha_0,\, \beta_0\!</math>||<math>\alpha_0+n\alpha,\, \beta_0+\sum_{i=1}^n x_i\!</math> | <math>\alpha_0/\alpha</math> observations with sum <math>\beta_0</math> | <math>\operatorname{CG}(\tilde{\mathbf{x}}\mid\alpha,{\alpha_0}',{\beta_0}')=\operatorname{\beta'}(\tilde{\mathbf{x}}|\alpha,{\alpha_0}',1,{\beta_0}')</math> <ref name="CG" group="note" /> |- | [[Inverse-gamma distribution|Inverse Gamma]] <br>with known shape ''α''|| ''β'' (inverse scale) || [[Gamma Distribution|Gamma]] || <math>\alpha_0,\, \beta_0\!</math>||<math>\alpha_0+n\alpha,\, \beta_0+\sum_{i=1}^n \frac{1}{x_i}\!</math> | <math>\alpha_0/\alpha</math> observations with sum <math>\beta_0</math> | |- | [[Gamma Distribution|Gamma]] <br>with known rate ''β''|| ''α'' (shape) | <math>\propto \frac{a^{\alpha-1} \beta^{\alpha c}}{\Gamma(\alpha)^b}</math> | <math>a,\, b,\, c\!</math>||<math>a \prod_{i=1}^n x_i,\, b + n,\, c + n\!</math> | <math>b</math> or <math>c</math> observations (<math>b</math> for estimating <math>\alpha</math>, <math>c</math> for estimating <math>\beta</math>) with product <math>a</math> | |- | [[Gamma Distribution|Gamma]]<ref name="Fink" />|| ''α'' (shape), ''β'' (inverse scale) || <math>\propto \frac{p^{\alpha-1} e^{-\beta q}}{\Gamma(\alpha)^r \beta^{-\alpha s}}</math>|| <math>p,\, q,\, r,\, s \!</math>|| <math>p \prod_{i=1}^n x_i,\, q + \sum_{i=1}^n x_i,\, r + n,\, s + n \!</math> | <math>\alpha</math> was estimated from <math>r</math> observations with product <math>p</math>; <math>\beta</math> was estimated from <math>s</math> observations with sum <math>q</math> | |- | [[Beta Distribution|Beta]]|| ''α'', ''β'' || <math>\propto \frac{\Gamma(\alpha+\beta)^k \, p^\alpha \, q^\beta}{\Gamma(\alpha)^k\,\Gamma(\beta)^k}</math>|| <math>p,\, q,\, k \!</math>|| <math>p \prod_{i=1}^n x_i,\, q \prod_{i=1}^n (1-x_i),\, k + n \!</math> | <math>\alpha</math> and <math>\beta</math> were estimated from <math>k</math> observations with product <math>p</math> and product of the complements <math>q</math> | |} == See also == * [[Beta-binomial distribution]] == Notes == {{NoteFoot |notes = <ref group=note name="beta-interp">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>\frac{\alpha}{\alpha + \beta},</math> which corresponds to <math>\alpha</math> successes and <math>\beta</math> failures, while the mode is <math>\frac{\alpha - 1}{\alpha + \beta - 2},</math> which corresponds to <math>\alpha - 1</math> successes and <math>\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>\alpha</math> and <math>\beta</math> is more convenient mathematically, while the use of <math>\alpha - 1</math> and <math>\beta - 1</math> has the advantage that a uniform <math>{\rm Beta}(1,1)</math> prior corresponds to 0 successes and 0 failures. The same issues apply to the [[Dirichlet distribution]].</ref> .<ref group=note name="posterior-hyperparameters">Denoted by the same symbols as the prior hyperparameters with primes added ('). For instance <math>\alpha</math> is denoted <math>\alpha'</math></ref> <ref group=note name=postpred>This is the [[posterior predictive distribution]] of a new data point <math>\tilde{x}</math> given the observed data points, with the parameters [[marginal distribution|marginalized out]]. Variables with primes indicate the posterior values of the parameters.</ref> <ref group=note name=ppredNt>This is the [[posterior predictive distribution]] of a new data point <math>\tilde{x}</math> given the observed data points, with the parameters [[marginal distribution|marginalized out]]. Variables with primes indicate the posterior values of the parameters. <math>\mathcal{N}</math> and <math>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.</ref> <ref group=note name="beta_rate">''β'' is rate or inverse scale. In parameterization of [[gamma distribution]],''θ'' = 1/''β'' and ''k'' = ''α''.</ref> <ref group=note name="beta_scale">In terms of the [[inverse gamma distribution|inverse gamma]], <math>\beta</math> is a [[scale parameter]]</ref> <ref group=note name=CG><math>\operatorname{CG}()</math> is a [[compound gamma distribution]]; <math>\operatorname{\beta'}()</math> here is a [[generalized beta prime distribution]].</ref> }} == References == {{Reflist |refs = <ref name="Fink">{{cite web |last = Fink |first = Daniel |date = 1997 |title = A Compendium of Conjugate Priors |url=https://courses.physics.ucsd.edu/2018/Fall/physics210b/REFERENCES/conjugate_priors.pdf | citeseerx = 10.1.1.157.5540 |archive-url=https://web.archive.org/web/20090529203101/http://www.people.cornell.edu/pages/df36/CONJINTRnew%20TEX.pdf |archive-date=May 29, 2009 }}</ref> }} [[Category:Bayesian statistics]] [[Category:Conjugate prior distributions| ]] [[Category:Statistics articles needing expert attention]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Bayesian statistics
(
edit
)
Template:Citation
(
edit
)
Template:Cite book
(
edit
)
Template:Harvtxt
(
edit
)
Template:More citations needed section
(
edit
)
Template:NoteFoot
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)