In a normal linear model , assign the coefficient vector a proper normal distribution with fixed positive-definite covariance matrix , independently of the variance , whose prior distribution is inverse-gamma distribution. Completing the square gives
Multiplying the residual likelihood function by the inverse-gamma distribution density also gives
These full conditional distributions permit a Gibbs sampler. The marginal coefficient posterior distribution is obtained by marginalization over . Its conditional mean and covariance matrix both depend on , so it is generally not a Student's t-distribution. Even if the columns of and the prior coordinates make the conditional coefficient components independent, averaging over a shared unknown need not preserve that independence.
A normal-inverse-gamma prior instead scales the conditional coefficient prior covariance matrix by , producing a multivariate Student's t-distribution on marginalization. It is a different joint prior distribution.
Let contain independent complete observations of the -dimensional vector, and let be a Directed acyclic graph. A Gaussian Bayesian network uses, for node ,
Here is an intercept, the vector of parent coefficients, and the conditional variance; the vector collects these statistical parameters. Its likelihood function factors as
Choose a proper statistical parameter prior distribution and a graph prior distribution . Bayes' theorem gives the Bayesian network structure score, up to the normalization common to graphs,
The integral is Bayesian model evidence: it averages over nuisance parameters rather than substituting their best-fitting values. A graph prior can favor sparse graphs, while the evidence balances fit against the amount of prior statistical parameter space that predicts the observations well. Compare these scores over admissible Directed acyclic graphs, using enumeration when feasible or a search procedure otherwise; search need not find a global maximum, and observational data need not identify a unique causal orientation.
A conjugate prior makes the integral analytic. For example, for take , , where is positive-definite matrix and ; these are independent local normal-inverse-gamma priors. Under prior independence between nodes, the evidence is a product of local regression evidences. Each posterior has the same family, so the local integral is the ratio of prior and posterior normalization constants, with the likelihood's constants included. This avoids costly numerical integration and makes local graph updates inexpensive. Hyperparameters must be specified coherently if score equivalence between observationally equivalent graphs is desired; arbitrary local priors do not automatically have that property.
An unknown variance requires a joint prior distribution for . The analysis is not determined until a prior for the unknown variance, and its relation to the coefficients, is specified. A maximum-likelihood estimate substituted for does not by itself account for its posterior uncertainty.
For example, retain the independent coefficient prior distributions from part (b) and independently assign an inverse-gamma distribution with shape and scale , whose probability density function is proportional to . Then the joint posterior density is proportional to
Conditional on , the two coefficient posterior distributions are still the independent normal distributions in part (b), with substituted for . The other full conditional distribution is
The marginal coefficient posterior distribution requires marginalization over ; it is generally nonnormal and the two coefficients need not remain independent. In particular, the posterior cumulative distribution function of the requested mean becomes
Its shortest 95% credible interval must be found from this marginal posterior distribution, for example by numerical integration or posterior simulation. This is normal regression with independent coefficient and variance priors.
A different, convenient choice is a normal-inverse-gamma prior, in which the conditional coefficient prior covariance matrix is proportional to . That choice gives a multivariate Student's t-distribution after marginalization, so the interval uses its univariate Student's t-distribution quantiles. It changes the coefficient prior specification; a Student interval does not follow automatically from retaining the fixed- priors in part (b).