Bayes factor 2026-09-28
A Bayes factor compares two models through the ratio of their model evidences, .
Bayesian network structure score Created 2026-10-05 Updated 2026-10-14
For observations and graph , Bayes' theorem gives . Here is the graph prior distribution and the local distribution statistical parameters. The integral is Bayesian model evidence; it averages over nuisance parameters with a proper statistical parameter prior distribution. For independent complete observations, the node-factorized likelihood function and independence of local statistical parameter prior distributions make the evidence factor over nodes; suitable conjugate priors can make the local integrals analytic. With missing node observations, integrating out unobserved values can couple the local parameters, so independence of local prior distributions alone does not guarantee this factorization. Proper priors and coherent hyperparameters matter for comparing different graphs.
Bayesian posterior Created 2026-09-24 Updated 2026-10-14
The Bayesian posterior is the conditional probability distribution of an unknown statistical parameter after observing data. Suppose a continuous prior distribution has prior density relative to Lebesgue measure , and is the sampling probability mass function or probability density function of the observed data in the statistical model. Bayes' theorem gives
The Bayesian model evidence is the normalization constant making the posterior density integrate to one. The strict positive, finite condition is essential: a zero or infinite normalizer does not define this posterior distribution, even if the unnormalized expression can be written down. Other reference measures give the corresponding density formula; discrete parameter values replace the integral by a sum. The posterior propriety article gives examples where normalization fails.
With fixed, is a likelihood function of . Its normalization as a sampling distribution is over possible data, not over parameter values. In particular, a likelihood function is not a probability density function for and need not integrate to one over . The prior density supplies the probability weighting, and the Bayesian model evidence normalizes their product. This distinction prevents a tempting mistake: reversing the conditioning merely by exchanging the words “data” and “parameter”.
For eight heads among ten conditionally independent Bernoulli trials, take the observed data to be the heads count . Its binomial distribution likelihood function and the prior density give
Using the Euler beta function , the Bayesian model evidence and normalized posterior density are
Thus the posterior distribution is . If the data are instead one particular ordered sequence with eight heads and two tails, its likelihood function omits the factor 45 and its Bayesian model evidence becomes . The factor cancels in Bayes' theorem, leaving the same posterior distribution; these two data descriptions have different sampling probabilities but identical information about here.
Figure 1.
Beta(2,2) prior, peak-normalized Bernoulli likelihood, and Beta(10,4) posterior after eight heads and two tails
. Details.
The prior density and posterior density use the left axis and each integrate to one. The dashed likelihood function uses the right axis and is divided by its maximum solely to compare its shape; it is not a parameter probability density function. The likelihood function peaks at , while the posterior mode is and the posterior mean is . Multiplying by the prior density shifts the preferred values toward one half while preserving a range of possibilities.
The resulting posterior variance is , compared with prior variance . In this example the update reduces uncertainty. The posterior predictive probability of heads on the next conditionally independent toss is , and the credible interval above reports a 95% range. These are summaries of the same posterior distribution, rather than competing estimates of one density peak.
Nuisance parameter 2026-10-05
A nuisance parameter is a statistical parameter required to specify the distribution of observations but not itself the target of inference. A profile likelihood maximizes over it; Bayesian model evidence integrates over it using a proper prior distribution. These operations differ and need not give the same inference. A baseline hazard in a Cox proportional-hazards model is an infinite-dimensional example.
Let , with all , and put . The independent exponential epoch times have joint density
Take a proper prior distribution density on , independent of the neutral genealogy. Independence is appropriate because the specified neutral Kingman's coalescent does not depend on the mutation parameter. The conditional observed-count likelihood function is
Its prior predictive probability, or Bayesian model evidence, is
Assuming , Bayes' theorem gives the joint posterior of mutation rate and coalescent times:
It is zero outside the prior support and positive-time region. For , use the usual convention in the Poisson mass. An improper prior cannot be sampled as the proposal in the following algorithm, even in cases where its formal posterior can be normalized.
Compute the Bayesian model evidence for each model by integrating its sampling density against its parameter prior:
The posterior odds are the prior odds multiplied by the Bayes factor:
The parameter priors used for evidence must be normalized; arbitrary normalization constants in model-specific improper priors would make this comparison undefined.
Use the orientation that favours the null hypothesis:
For a composite model the denominator is its Bayesian model evidence, obtained by integrating the likelihood against the model's prior distribution. This Bayes factor exceeds one when the observed data have greater marginal probability under . By Bayes' theorem,
Thus the posterior odds equal the prior odds multiplied by the Bayes factor. The reciprocal orientation instead gives .
The joint prior predictive distribution is the Bayesian model evidence, obtained by integrating over the shared parameter:
It is zero otherwise. This uniform-Pareto model evidence is a joint density, not the product of separately marginalized observation densities: mixing over the common parameter induces dependence.
The Type II maximum likelihood estimator maximizes the Bayesian model evidence after integrating out the breed parameters:
For positive sample sizes define . Up to an additive constant, the log-likelihood is
Differentiation gives the interior score equation
Also . If , the derivative decreases from infinity to , so a unique finite maximum exists. When all sample sizes equal , the equation becomes , giving
For no finite maximum exists. Plugging this hyperparameter estimate into the breed posterior distributions is an Empirical Bayes method.
Here for every breed, so and
The Bayesian model evidence increases towards its supremum as . Thus
For a Pareto distribution, . The limiting empirical prior, and each corresponding posterior distribution, collapses onto .
The boundary result is coherent within the assumed model: the observations favour the smallest allowed upper limits. Nevertheless, reporting exact concentration on a prespecified bound is overconfident for finite data and ignores hyperparameter uncertainty. A proper hyperprior on , sensitivity analysis for , or a scientifically justified restriction on concentration avoids treating this limit as certain biological knowledge.
Model gives the sequential forecast . The probability chain rule yields
Application of Bayes' theorem makes the factors successive posterior predictive distributions, and their product is the Bayesian model evidence. Under conditionally independent sampling it is
Taking logarithms gives the prequential log score identity
Therefore the Bayes factor is
This solves the second half of part (d), which is missing from the TeX. Proper priors and finite positive evidences are needed; unrelated improper-prior normalizing constants do not cancel.
Write , with independent and . The convolution of independent random variables is again a normal distribution, so the prior predictive laws are
These are predictive distributions before observing , hence the Bayesian model evidence for the observed mean. The residual information in the original observations is common to both models and cancels in their Bayes factor.
Divide the two normal distribution predictive densities to obtain the Bayes factor
At this becomes
The wider prior distribution spreads its predictive mass over more possible means, giving the narrower model more Bayesian model evidence for observations very near zero. Away from zero, the exponential term opposes that factor.
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.
Let be the probability density function of the unknown and that of the noise, both relative to Lebesgue measure. By independence of random variables, the conditional distribution of the measurement given has density . Thus its likelihood function and the joint density are
The Bayesian model evidence is the marginal data density
Bayes' theorem gives the posterior density solving this Bayesian inverse problem:
This formula applies when . Since by Tonelli theorem, these conditions hold almost everywhere under the marginal data law. Values of a conditional distribution at exceptional data are not determined by the joint law. The posterior mean or a maximum a posteriori estimate can then give a point estimate, while the full posterior density describes the remaining uncertainty.
Let be the likelihood function. Since the prior distribution is , the posterior density has the form
where is the normalizing constant.
Choose and use the Gaussian autoregressive proposal reversible with respect to a standard normal distribution
Thus
whose covariance matrix is the required . Reversibility with respect to the standard normal distribution says
so
The Metropolis–Hastings acceptance probability therefore reduces to
This is the Preconditioned Crank–Nicolson algorithm with proposal scale .
One simple algorithm is importance sampling from the prior. Draw independently from and assign weight . Then
estimates the Bayesian model evidence, and the normalized weights represent the posterior. A weighted histogram or kernel density estimation of the estimates the marginal ; discarding performs the marginalization.