Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Normal-gamma distribution

From Wikipedia, the free encyclopedia
Family of continuous probability distributions
normal-gamma
Parametersμ{\displaystyle \mu \,}location (real)
λ>0{\displaystyle \lambda >0\,} (real)
α>0{\displaystyle \alpha >0\,} (real)
β>0{\displaystyle \beta >0\,} (real)
Supportx(,),τ(0,){\displaystyle x\in (-\infty ,\infty )\,\!,\;\tau \in (0,\infty )}
PDFf(x,τμ,λ,α,β)=βαλΓ(α)2πτα12eβτeλτ(xμ)22{\displaystyle f(x,\tau \mid \mu ,\lambda ,\alpha ,\beta )={\frac {\beta ^{\alpha }{\sqrt {\lambda }}}{\Gamma (\alpha ){\sqrt {2\pi }}}}\,\tau ^{\alpha -{\frac {1}{2}}}\,e^{-\beta \tau }\,e^{-{\frac {\lambda \tau (x-\mu )^{2}}{2}}}}
Mean[1]E(X)=μ,E(T)=αβ1{\displaystyle \operatorname {E} (X)=\mu \,\!,\quad \operatorname {E} (\mathrm {T} )=\alpha \beta ^{-1}}
Mode(μ,α12β){\displaystyle \left(\mu ,{\frac {\alpha -{\frac {1}{2}}}{\beta }}\right)}
Variance[1]var(X)=(βλ(α1)),var(T)=αβ2{\displaystyle \operatorname {var} (X)={\Big (}{\frac {\beta }{\lambda (\alpha -1)}}{\Big )},\quad \operatorname {var} (\mathrm {T} )=\alpha \beta ^{-2}}

Inprobability theory andstatistics, thenormal-gamma distribution (orGaussian-gamma distribution) is a bivariate four-parameter family of continuousprobability distributions. It is theconjugate prior of anormal distribution with unknownmean andprecision.[2]

Definition

[edit]

For a pair ofrandom variables, (X,T), suppose that theconditional distribution ofX givenT is given by

XTN(μ,1/(λT)),{\displaystyle X\mid T\sim N(\mu ,1/(\lambda T))\,\!,}

meaning that the conditional distribution is anormal distribution withmeanμ{\displaystyle \mu } andprecisionλT{\displaystyle \lambda T} — equivalently, withvariance1/(λT).{\displaystyle 1/(\lambda T).}

Suppose also that the marginal distribution ofT is given by

Tα,βGamma(α,β),{\displaystyle T\mid \alpha ,\beta \sim \operatorname {Gamma} (\alpha ,\beta ),}

where this means thatT has agamma 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(μ,λ,α,β).{\displaystyle (X,T)\sim \operatorname {NormalGamma} (\mu ,\lambda ,\alpha ,\beta ).}

Properties

[edit]

Probability density function

[edit]

The jointprobability density function of (X,T) is

f(x,τμ,λ,α,β)=βαλΓ(α)2πτα12eβτexp(λτ(xμ)22),{\displaystyle f(x,\tau \mid \mu ,\lambda ,\alpha ,\beta )={\frac {\beta ^{\alpha }{\sqrt {\lambda }}}{\Gamma (\alpha ){\sqrt {2\pi }}}}\,\tau ^{\alpha -{\frac {1}{2}}}\,e^{-\beta \tau }\exp \left(-{\frac {\lambda \tau (x-\mu )^{2}}{2}}\right),}

where theconditional probability forf(x,τμ,λ,α,β)=f(xτ,μ,λ,α,β)f(τμ,λ,α,β){\displaystyle f(x,\tau \mid \mu ,\lambda ,\alpha ,\beta )=f(x\mid \tau ,\mu ,\lambda ,\alpha ,\beta )f(\tau \mid \mu ,\lambda ,\alpha ,\beta )}was used.

Marginal distributions

[edit]

By construction, themarginal distribution ofτ{\displaystyle \tau } is agamma distribution, and theconditional distribution ofx{\displaystyle x} givenτ{\displaystyle \tau } is aGaussian distribution. Themarginal distribution ofx{\displaystyle x} is a three-parameter non-standardizedStudent's t-distribution with parameters(ν,μ,σ2)=(2α,μ,β/(λα)){\displaystyle (\nu ,\mu ,\sigma ^{2})=(2\alpha ,\mu ,\beta /(\lambda \alpha ))}.[citation needed]

Exponential family

[edit]

The normal-gamma distribution is a four-parameterexponential family withnatural parametersα1/2,βλμ2/2,λμ,λ/2{\displaystyle \alpha -1/2,-\beta -\lambda \mu ^{2}/2,\lambda \mu ,-\lambda /2} andnatural statisticslnτ,τ,τx,τx2{\displaystyle \ln \tau ,\tau ,\tau x,\tau x^{2}}.[citation needed]

Moments of the natural statistics

[edit]

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

E(lnT)=ψ(α)lnβ,{\displaystyle \operatorname {E} (\ln T)=\psi \left(\alpha \right)-\ln \beta ,}

whereψ(α){\displaystyle \psi \left(\alpha \right)} is thedigamma function,

E(T)=αβ,E(TX)=μαβ,E(TX2)=1λ+μ2αβ.{\displaystyle {\begin{aligned}\operatorname {E} (T)&={\frac {\alpha }{\beta }},\\[5pt]\operatorname {E} (TX)&=\mu {\frac {\alpha }{\beta }},\\[5pt]\operatorname {E} (TX^{2})&={\frac {1}{\lambda }}+\mu ^{2}{\frac {\alpha }{\beta }}.\end{aligned}}}

Scaling

[edit]

If(X,T)NormalGamma(μ,λ,α,β),{\displaystyle (X,T)\sim \mathrm {NormalGamma} (\mu ,\lambda ,\alpha ,\beta ),} then for anyb>0,(bX,bT){\displaystyle b>0,(bX,bT)} is distributed as[citation needed]NormalGamma(bμ,λ/b3,α,β/b).{\displaystyle {\rm {NormalGamma}}(b\mu ,\lambda /b^{3},\alpha ,\beta /b).}

Posterior distribution of the parameters

[edit]

Assume thatx is distributed according to a normal distribution with unknown meanμ{\displaystyle \mu } and precisionτ{\displaystyle \tau }.

xN(μ,τ1){\displaystyle x\sim {\mathcal {N}}(\mu ,\tau ^{-1})}

and that the prior distribution onμ{\displaystyle \mu } andτ{\displaystyle \tau },(μ,τ){\displaystyle (\mu ,\tau )}, has a normal-gamma distribution

(μ,τ)NormalGamma(μ0,λ0,α0,β0),{\displaystyle (\mu ,\tau )\sim {\text{NormalGamma}}(\mu _{0},\lambda _{0},\alpha _{0},\beta _{0}),}

for which the densityπ satisfies

π(μ,τ)τα012exp[β0τ]exp[λ0τ(μμ0)22].{\displaystyle \pi (\mu ,\tau )\propto \tau ^{\alpha _{0}-{\frac {1}{2}}}\,\exp[-\beta _{0}\tau ]\,\exp \left[-{\frac {\lambda _{0}\tau (\mu -\mu _{0})^{2}}{2}}\right].}

Suppose

x1,,xnμ,τi.i.d.N(μ,τ1),{\displaystyle x_{1},\ldots ,x_{n}\mid \mu ,\tau \sim \operatorname {{i.}{i.}{d.}} \operatorname {N} \left(\mu ,\tau ^{-1}\right),}

i.e. the components ofX=(x1,,xn){\displaystyle \mathbf {X} =(x_{1},\ldots ,x_{n})} are conditionally independent givenμ,τ{\displaystyle \mu ,\tau } and the conditional distribution of each of them givenμ,τ{\displaystyle \mu ,\tau } is normal with expected valueμ{\displaystyle \mu } and variance1/τ.{\displaystyle 1/\tau .} The posterior distribution ofμ{\displaystyle \mu } andτ{\displaystyle \tau } given this datasetX{\displaystyle \mathbb {X} } can be analytically determined byBayes' theorem[4] explicitly,

P(τ,μX)L(Xτ,μ)π(τ,μ),{\displaystyle \mathbf {P} (\tau ,\mu \mid \mathbf {X} )\propto \mathbf {L} (\mathbf {X} \mid \tau ,\mu )\pi (\tau ,\mu ),}

whereL{\displaystyle \mathbf {L} } 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:

L(Xτ,μ)=i=1nL(xiτ,μ).{\displaystyle \mathbf {L} (\mathbf {X} \mid \tau ,\mu )=\prod _{i=1}^{n}\mathbf {L} (x_{i}\mid \tau ,\mu ).}

This expression can be simplified as follows:

L(Xτ,μ)i=1nτ1/2exp[τ2(xiμ)2]τn/2exp[τ2i=1n(xiμ)2]τn/2exp[τ2i=1n(xix¯+x¯μ)2]τn/2exp[τ2i=1n((xix¯)2+(x¯μ)2)]τn/2exp[τ2(ns+n(x¯μ)2)],{\displaystyle {\begin{aligned}\mathbf {L} (\mathbf {X} \mid \tau ,\mu )&\propto \prod _{i=1}^{n}\tau ^{1/2}\exp \left[{\frac {-\tau }{2}}(x_{i}-\mu )^{2}\right]\\[5pt]&\propto \tau ^{n/2}\exp \left[{\frac {-\tau }{2}}\sum _{i=1}^{n}(x_{i}-\mu )^{2}\right]\\[5pt]&\propto \tau ^{n/2}\exp \left[{\frac {-\tau }{2}}\sum _{i=1}^{n}(x_{i}-{\bar {x}}+{\bar {x}}-\mu )^{2}\right]\\[5pt]&\propto \tau ^{n/2}\exp \left[{\frac {-\tau }{2}}\sum _{i=1}^{n}\left((x_{i}-{\bar {x}})^{2}+({\bar {x}}-\mu )^{2}\right)\right]\\[5pt]&\propto \tau ^{n/2}\exp \left[{\frac {-\tau }{2}}\left(ns+n({\bar {x}}-\mu )^{2}\right)\right],\end{aligned}}}

wherex¯=1ni=1nxi{\displaystyle {\bar {x}}={\frac {1}{n}}\sum _{i=1}^{n}x_{i}}, the mean of the data samples, ands=1ni=1n(xix¯)2{\displaystyle s={\frac {1}{n}}\sum _{i=1}^{n}(x_{i}-{\bar {x}})^{2}}, the sample variance.

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

P(τ,μX)L(Xτ,μ)π(τ,μ)τn/2exp[τ2(ns+n(x¯μ)2)]τα012exp[β0τ]exp[λ0τ(μμ0)22]τn2+α012exp[τ(12ns+β0)]exp[τ2(λ0(μμ0)2+n(x¯μ)2)]{\displaystyle {\begin{aligned}\mathbf {P} (\tau ,\mu \mid \mathbf {X} )&\propto \mathbf {L} (\mathbf {X} \mid \tau ,\mu )\pi (\tau ,\mu )\\&\propto \tau ^{n/2}\exp \left[{\frac {-\tau }{2}}\left(ns+n({\bar {x}}-\mu )^{2}\right)\right]\tau ^{\alpha _{0}-{\frac {1}{2}}}\,\exp[{-\beta _{0}\tau }]\,\exp \left[-{\frac {\lambda _{0}\tau (\mu -\mu _{0})^{2}}{2}}\right]\\&\propto \tau ^{{\frac {n}{2}}+\alpha _{0}-{\frac {1}{2}}}\exp \left[-\tau \left({\frac {1}{2}}ns+\beta _{0}\right)\right]\exp \left[-{\frac {\tau }{2}}\left(\lambda _{0}(\mu -\mu _{0})^{2}+n({\bar {x}}-\mu )^{2}\right)\right]\end{aligned}}}

The final exponential term is simplified by completing the square.

λ0(μμ0)2+n(x¯μ)2=λ0μ22λ0μμ0+λ0μ02+nμ22nx¯μ+nx¯2=(λ0+n)μ22(λ0μ0+nx¯)μ+λ0μ02+nx¯2=(λ0+n)(μ22λ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{\displaystyle {\begin{aligned}\lambda _{0}(\mu -\mu _{0})^{2}+n({\bar {x}}-\mu )^{2}&=\lambda _{0}\mu ^{2}-2\lambda _{0}\mu \mu _{0}+\lambda _{0}\mu _{0}^{2}+n\mu ^{2}-2n{\bar {x}}\mu +n{\bar {x}}^{2}\\&=(\lambda _{0}+n)\mu ^{2}-2(\lambda _{0}\mu _{0}+n{\bar {x}})\mu +\lambda _{0}\mu _{0}^{2}+n{\bar {x}}^{2}\\&=(\lambda _{0}+n)(\mu ^{2}-2{\frac {\lambda _{0}\mu _{0}+n{\bar {x}}}{\lambda _{0}+n}}\mu )+\lambda _{0}\mu _{0}^{2}+n{\bar {x}}^{2}\\&=(\lambda _{0}+n)\left(\mu -{\frac {\lambda _{0}\mu _{0}+n{\bar {x}}}{\lambda _{0}+n}}\right)^{2}+\lambda _{0}\mu _{0}^{2}+n{\bar {x}}^{2}-{\frac {\left(\lambda _{0}\mu _{0}+n{\bar {x}}\right)^{2}}{\lambda _{0}+n}}\\&=(\lambda _{0}+n)\left(\mu -{\frac {\lambda _{0}\mu _{0}+n{\bar {x}}}{\lambda _{0}+n}}\right)^{2}+{\frac {\lambda _{0}n({\bar {x}}-\mu _{0})^{2}}{\lambda _{0}+n}}\end{aligned}}}

On inserting this back into the expression above,

P(τ,μX)τn2+α012exp[τ(12ns+β0)]exp[τ2((λ0+n)(μλ0μ0+nx¯λ0+n)2+λ0n(x¯μ0)2λ0+n)]τn2+α012exp[τ(12ns+β0+λ0n(x¯μ0)22(λ0+n))]exp[τ2(λ0+n)(μλ0μ0+nx¯λ0+n)2]{\displaystyle {\begin{aligned}\mathbf {P} (\tau ,\mu \mid \mathbf {X} )&\propto \tau ^{{\frac {n}{2}}+\alpha _{0}-{\frac {1}{2}}}\exp \left[-\tau \left({\frac {1}{2}}ns+\beta _{0}\right)\right]\exp \left[-{\frac {\tau }{2}}\left(\left(\lambda _{0}+n\right)\left(\mu -{\frac {\lambda _{0}\mu _{0}+n{\bar {x}}}{\lambda _{0}+n}}\right)^{2}+{\frac {\lambda _{0}n({\bar {x}}-\mu _{0})^{2}}{\lambda _{0}+n}}\right)\right]\\&\propto \tau ^{{\frac {n}{2}}+\alpha _{0}-{\frac {1}{2}}}\exp \left[-\tau \left({\frac {1}{2}}ns+\beta _{0}+{\frac {\lambda _{0}n({\bar {x}}-\mu _{0})^{2}}{2(\lambda _{0}+n)}}\right)\right]\exp \left[-{\frac {\tau }{2}}\left(\lambda _{0}+n\right)\left(\mu -{\frac {\lambda _{0}\mu _{0}+n{\bar {x}}}{\lambda _{0}+n}}\right)^{2}\right]\end{aligned}}}

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

P(τ,μX)=NormalGamma(λ0μ0+nx¯λ0+n,λ0+n,α0+n2,β0+12(ns+λ0n(x¯μ0)2λ0+n)){\displaystyle \mathbf {P} (\tau ,\mu \mid \mathbf {X} )={\text{NormalGamma}}\left({\frac {\lambda _{0}\mu _{0}+n{\bar {x}}}{\lambda _{0}+n}},\lambda _{0}+n,\alpha _{0}+{\frac {n}{2}},\beta _{0}+{\frac {1}{2}}\left(ns+{\frac {\lambda _{0}n({\bar {x}}-\mu _{0})^{2}}{\lambda _{0}+n}}\right)\right)}

Interpretation of parameters

[edit]

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 from2α{\displaystyle 2\alpha } 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μ{\displaystyle \mu } and sample varianceβα{\displaystyle {\frac {\beta }{\alpha }}} (i.e. with sum ofsquared deviations2β{\displaystyle 2\beta }).
  • The posterior updates the number of pseudo-observations (λ0{\displaystyle \lambda _{0}}) simply by adding the corresponding number of new observations (n{\displaystyle 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{\displaystyle \mu _{0}} fromnμ{\displaystyle n_{\mu }} samples and a prior precision ofτ0{\displaystyle \tau _{0}} fromnτ{\displaystyle n_{\tau }} samples, the prior distribution overμ{\displaystyle \mu } andτ{\displaystyle \tau } is

P(τ,μX)=NormalGamma(μ0,nμ,nτ2,nτ2τ0){\displaystyle \mathbf {P} (\tau ,\mu \mid \mathbf {X} )=\operatorname {NormalGamma} \left(\mu _{0},n_{\mu },{\frac {n_{\tau }}{2}},{\frac {n_{\tau }}{2\tau _{0}}}\right)}

and after observingn{\displaystyle n} samples with meanμ{\displaystyle \mu } and variances{\displaystyle s}, the posterior probability is

P(τ,μX)=NormalGamma(nμμ0+nμnμ+n,nμ+n,12(nτ+n),12(nττ0+ns+nμn(μμ0)2nμ+n)){\displaystyle \mathbf {P} (\tau ,\mu \mid \mathbf {X} )={\text{NormalGamma}}\left({\frac {n_{\mu }\mu _{0}+n\mu }{n_{\mu }+n}},n_{\mu }+n,{\frac {1}{2}}(n_{\tau }+n),{\frac {1}{2}}\left({\frac {n_{\tau }}{\tau _{0}}}+ns+{\frac {n_{\mu }n(\mu -\mu _{0})^{2}}{n_{\mu }+n}}\right)\right)}

Note that in some programming languages, such asMatlab, the gamma distribution is implemented with the inverse definition ofβ{\displaystyle \beta }, so the fourth argument of the Normal-Gamma distribution is2τ0/nτ{\displaystyle 2\tau _{0}/n_{\tau }}.

Generating normal-gamma random variates

[edit]

Generation of random variates is straightforward:

  1. Sampleτ{\displaystyle \tau } from a gamma distribution with parametersα{\displaystyle \alpha } andβ{\displaystyle \beta }
  2. Samplex{\displaystyle x} from a normal distribution with meanμ{\displaystyle \mu } and variance1/(λτ){\displaystyle 1/(\lambda \tau )}

Related distributions

[edit]

Notes

[edit]
  1. ^abBernardo & 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, retrieved2023-12-08{{citation}}: CS1 maint: work parameter with ISBN (link)
  4. ^"Bayes' Theorem: Introduction".Archived from the original on 2014-08-07. Retrieved2014-08-05.

References

[edit]
  • 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.
Discrete
univariate
with finite
support
with infinite
support
Continuous
univariate
supported on a
bounded interval
supported on a
semi-infinite
interval
supported
on the whole
real line
with support
whose type varies
Mixed
univariate
continuous-
discrete
Multivariate
(joint)
Directional
Degenerate
andsingular
Degenerate
Dirac delta function
Singular
Cantor
Families
Retrieved from "https://en.wikipedia.org/w/index.php?title=Normal-gamma_distribution&oldid=1264461505"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp