Normal-gamma distribution

Short description: Family of continuous probability distributions

normal-gammaParameters|  μ location (real)
λ>0 (real)
α>0 (real)
β>0 (real)

|

Support|  x∈(−∞,∞),τ∈(0,∞)
PDF|  f(x,τ∣μ,λ,α,β)=βαλΓ(α)2πτα−12e−βτe−λτ(x−μ)22
Mean|  [1] E⁡(X)=μ,E⁡(T)=αβ−1
Mode|  (μ,α−12β)
Variance|  [1] var⁡(X)=(βλ(α−1)),var⁡(T)=αβ−2

In probability theory and statistics, the normal-gamma distribution (or Gaussian-gamma distribution) is a bivariate four-parameter family of continuous probability distributions. It is the conjugate prior of a normal distribution with unknown mean and precision.[2]

## Contents

* 1 Definition
* 2 Properties
* 2.1 Probability density function
* 2.2 Marginal distributions
* 2.3 Exponential family
* 2.4 Moments of the natural statistics
* 2.5 Scaling
* 3 Posterior distribution of the parameters
* 3.1 Interpretation of parameters
* 4 Generating normal-gamma random variates
* 5 Related distributions
* 6 Notes
* 7 References

## Definition

For a pair of random variables, (X,T), suppose that the conditional distribution of X given T is given by

X∣T∼N(μ,1/(λT)),

meaning that the conditional distribution is a normal distribution with mean μ and precision λT — equivalently, with variance 1/(λT).

Suppose also that the marginal distribution of T is given by

T∣α,β∼Gamma⁡(α,β),

where this means that T has a gamma distribution. Here λ, α and β are parameters of the joint distribution.

Then (X,T) has a normal-gamma distribution, and this is denoted by

(X,T)∼NormalGamma⁡(μ,λ,α,β).

## Properties

### Probability density function

The joint probability density function of (X,T) is[citation needed]

f(x,τ∣μ,λ,α,β)=βαλΓ(α)2πτα−12e−βτexp⁡(−λτ(x−μ)22)

### Marginal distributions

By construction, the marginal distribution of τ is a gamma distribution, and the conditional distribution of x given τ is a Gaussian distribution. The marginal distribution of x is a three-parameter non-standardized Student's t-distribution with parameters (ν,μ,σ2)=(2α,μ,β/(λα)).[citation needed]

### Exponential family

The normal-gamma distribution is a four-parameter exponential family with natural parameters α−1/2,−β−λμ2/2,λμ,−λ/2 and natural statistics ln⁡τ,τ,τx,τx2.[citation needed]

### Moments of the natural statistics

The following moments can be easily computed using the moment generating function of the sufficient statistic:[3]

E⁡(ln⁡T)=ψ(α)−ln⁡β,

where ψ(α) is the digamma function,

E⁡(T)=αβ,E⁡(TX)=μαβ,E⁡(TX2)=1λ+μ2αβ.

### Scaling

If (X,T)∼NormalGamma(μ,λ,α,β), then for any b>0,(bX,bT) is distributed as[citation needed] NormalGamma(bμ,λ/b3,α,β/b).

## Posterior distribution of the parameters

Assume that x is distributed according to a normal distribution with unknown mean μ and precision τ.

x∼𝒩(μ,τ−1)

and that the prior distribution on μ and τ, (μ,τ), has a normal-gamma distribution

(μ,τ)∼NormalGamma(μ0,λ0,α0,β0),

for which the density π satisfies

π(μ,τ)∝τα0−12exp⁡[−β0τ]exp⁡[−λ0τ(μ−μ0)22].

Suppose

x1,…,xn∣μ,τ∼i.i.d.⁡N⁡(μ,τ−1),

i.e. the components of 𝐗=(x1,…,xn) are conditionally independent given μ,τ and the conditional distribution of each of them given μ,τ is normal with expected value μ and variance 1/τ. The posterior distribution of μ and τ given this dataset 𝕏 can be analytically determined by Bayes' theorem[4] explicitly,

𝐏(τ,μ∣𝐗)∝𝐋(𝐗∣τ,μ)π(τ,μ),

where 𝐋 is the likelihood of the parameters given the data.

Since the data are i.i.d, the likelihood of the entire dataset is equal to the product of the likelihoods of the individual data samples:

𝐋(𝐗∣τ,μ)=∏i=1n𝐋(xi∣τ,μ).

This expression can be simplified as follows:

𝐋(𝐗∣τ,μ)∝∏i=1nτ1/2exp⁡[−τ2(xi−μ)2]∝τn/2exp⁡[−τ2∑i=1n(xi−μ)2]∝τn/2exp⁡[−τ2∑i=1n(xi−x¯+x¯−μ)2]∝τn/2exp⁡[−τ2∑i=1n((xi−x¯)2+(x¯−μ)2)]∝τn/2exp⁡[−τ2(ns+n(x¯−μ)2)],

where x¯=1n∑i=1nxi, the mean of the data samples, and s=1n∑i=1n(xi−x¯)2, the sample variance.

The posterior distribution of the parameters is proportional to the prior times the likelihood.

𝐏(τ,μ∣𝐗)∝𝐋(𝐗∣τ,μ)π(τ,μ)∝τn/2exp⁡[−τ2(ns+n(x¯−μ)2)]τα0−12exp⁡[−β0τ]exp⁡[−λ0τ(μ−μ0)22]∝τn2+α0−12exp⁡[−τ(12ns+β0)]exp⁡[−τ2(λ0(μ−μ0)2+n(x¯−μ)2)]

The final exponential term is simplified by completing the square.

λ0(μ−μ0)2+n(x¯−μ)2=λ0μ2−2λ0μμ0+λ0μ02+nμ2−2nx¯μ+nx¯2=(λ0+n)μ2−2(λ0μ0+nx¯)μ+λ0μ02+nx¯2=(λ0+n)(μ2−2λ0μ0+nx¯λ0+nμ)+λ0μ02+nx¯2=(λ0+n)(μ−λ0μ0+nx¯λ0+n)2+λ0μ02+nx¯2−(λ0μ0+nx¯)2λ0+n=(λ0+n)(μ−λ0μ0+nx¯λ0+n)2+λ0n(x¯−μ0)2λ0+n

On inserting this back into the expression above,

𝐏(τ,μ∣𝐗)∝τn2+α0−12exp⁡[−τ(12ns+β0)]exp⁡[−τ2((λ0+n)(μ−λ0μ0+nx¯λ0+n)2+λ0n(x¯−μ0)2λ0+n)]∝τn2+α0−12exp⁡[−τ(12ns+β0+λ0n(x¯−μ0)22(λ0+n))]exp⁡[−τ2(λ0+n)(μ−λ0μ0+nx¯λ0+n)2]

This final expression is in exactly the same form as a Normal-Gamma distribution, i.e.,

𝐏(τ,μ∣𝐗)=NormalGamma(λ0μ0+nx¯λ0+n,λ0+n,α0+n2,β0+12(ns+λ0n(x¯−μ0)2λ0+n))

### Interpretation of parameters

The interpretation of parameters in terms of pseudo-observations is as follows:

* The new mean takes a weighted average of the old pseudo-mean and the observed mean, weighted by the number of associated (pseudo-)observations.
* The precision was estimated from 2α pseudo-observations (i.e. possibly a different number of pseudo-observations, to allow the variance of the mean and precision to be controlled separately) with sample mean μ and sample variance βα (i.e. with sum of squared deviations 2β).
* The posterior updates the number of pseudo-observations (λ0) simply by adding the corresponding number of new observations (n).
* The new sum of squared deviations is computed by adding the previous respective sums of squared deviations. However, a third "interaction term" is needed because the two sets of squared deviations were computed with respect to different means, and hence the sum of the two underestimates the actual total squared deviation.

As a consequence, if one has a prior mean of μ0 from nμ samples and a prior precision of τ0 from nτ samples, the prior distribution over μ and τ is

𝐏(τ,μ∣𝐗)=NormalGamma⁡(μ0,nμ,nτ2,nτ2τ0)

and after observing n samples with mean μ and variance s, the posterior probability is

𝐏(τ,μ∣𝐗)=NormalGamma(nμμ0+nμnμ+n,nμ+n,12(nτ+n),12(nττ0+ns+nμn(μ−μ0)2nμ+n))

Note that in some programming languages, such as Matlab, the gamma distribution is implemented with the inverse definition of β, so the fourth argument of the Normal-Gamma distribution is 2τ0/nτ.

## Generating normal-gamma random variates

Generation of random variates is straightforward:

1. Sample τ from a gamma distribution with parameters α and β
2. Sample x from a normal distribution with mean μ and variance 1/(λτ)

## Related distributions

* The normal-inverse-gamma distribution is essentially the same distribution parameterized by variance rather than precision
* The normal-exponential-gamma distribution

## Notes

1. ↑ 1.0 1.1 Bernardo & Smith (1993, p. 434)
2. ↑ Bernardo & Smith (1993, pages 136, 268, 434)
3. ↑ Wasserman, Larry (2004), "Parametric Inference", Springer Texts in Statistics (New York, NY: Springer New York): pp. 119–148, ISBN 978-1-4419-2322-6, http://dx.doi.org/10.1007/978-0-387-21736-9_9, retrieved 2023-12-08
4. ↑ "Bayes' Theorem: Introduction". http://www.trinity.edu/cbrown/bayesweb/.

## References

* Bernardo, J.M.; Smith, A.F.M. (1993) Bayesian Theory, Wiley. ISBN 0-471-49464-X
* Dearden et al. "Bayesian Q-learning", Proceedings of the Fifteenth National Conference on Artificial Intelligence (AAAI-98), July 26–30, 1998, Madison, Wisconsin, USA.

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Normal-gamma distribution. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Normal-gamma_distribution&oldid=188204"