Wikipedia / Normal-gamma distribution
Wikipedia / Normal-gamma distribution
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.
Definition
For a pair of random variables, (X,T), suppose that the conditional distribution of X given T is given by
meaning that the conditional distribution is a normal distribution with mean and precision — equivalently, with variance
Suppose also that the marginal distribution of T is given by
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
Properties
Probability density function
The joint probability density function of (X,T) is
where the conditional probability was used.
Marginal distributions
By construction, the marginal distribution is a gamma distribution, and the conditional distribution is a Gaussian distribution. The marginal distribution is a three-parameter non-standardized Student's t-distribution.
Exponential family
The normal-gamma distribution is a four-parameter exponential family with natural parameters and natural statistics.
Moments of the natural statistics
The following moments can be easily computed using the moment generating function of the sufficient statistic:
is the digamma function,
Scaling
is distributed as
Posterior distribution of the parameters
Assume that x.
, has a normal-gamma distribution
for which the density satisfies
Suppose
can be analytically determined by Bayes' theorem explicitly,
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:
This expression can be simplified as follows:
, the sample variance.
The posterior distribution of the parameters is proportional to the prior times the likelihood.
The final exponential term is simplified by completing the square.
On inserting this back into the expression above,
This final expression is in exactly the same form as a Normal-Gamma distribution, i.e.,
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.
(i.e. with sum of squared deviations).
).
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.
is
, the posterior probability is
Note that in some programming languages, such as Matlab.
Generating normal-gamma random variates
Generation of random variates is straightforward:
Related distributions
The normal-inverse-gamma distribution is the same distribution parameterized by variance rather than precision
Notes
References