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.
Jeffreys prior Created 2026-10-05 Updated 2026-10-14
The Jeffreys prior uses the square root of the determinant of the Fisher information matrix as a parameter-density kernel. It is invariant under smooth one-to-one reparameterization, since the information and density Jacobians transform compatibly. It may be an improper prior; invariance does not guarantee posterior propriety. With nuisance parameters, a scalar conditional Jeffreys prior and the joint Jeffreys prior need not coincide.
Several chains from dispersed initial states, trace plots, autocorrelation, effective sample sizes, and the rank-normalized split potential scale reduction factor assess mixing and disagreement between chains. An close to one is useful evidence but cannot prove convergence or prove posterior propriety. Comparing chains that explore different modes is especially important; monitor each scientifically important observable and its Monte Carlo uncertainty. A long apparent plateau can also occur when an improper-target sampler is drifting toward a boundary.
A constant improper prior would give the formal posterior density kernel . However,
There is no normalized posterior distribution under this prior. The failure is not simply that the prior is improper: some improper priors give proper posteriors. Here posterior propriety itself fails after this single observation, so probabilities, quantiles and a posterior mean cannot be assigned to that kernel.
The Metropolis–Hastings algorithm proposes and moves from the current state with acceptance probability
On rejection it retains . The target need only be known up to its normalizing constant, but it must define a proper probability distribution. The accepted off-diagonal probability flow is
which is symmetric in and proves detailed balance. This permits considerable flexibility in proposals, including joint moves when a posterior distribution has strongly correlated parameters, but requires proposal tuning and can waste computation on rejections.
A Gibbs sampler instead updates a coordinate or block from its exact full conditional distribution, holding the other coordinates fixed. This is a special Metropolis–Hastings algorithm update with acceptance probability one: the joint density factors into the unchanged marginal density and the proposed conditional density, which cancel in the acceptance ratio. The coordinate update preserves the target; composing such updates therefore preserves it too, although an entire deterministic sweep need not itself be reversible.
Use Gibbs sampling when the conditional laws are easy to simulate and suitably chosen blocks mix well. Scalar updates can mix poorly under strong posterior distribution correlation, whereas a blocked Gibbs sampler can alleviate that dependence. Prefer a flexible Metropolis proposal when conditional draws are difficult or a well-tuned joint proposal is more effective. Variations include random or systematic coordinate scans, random-walk Metropolis algorithms, independence proposals, and using Metropolis updates for difficult blocks inside a Gibbs scheme. Both methods generate dependent draws; usable long-run estimates require an appropriate irreducible, aperiodic chain and assessment of mixing, not merely a formal update rule.
For the change-point calculation, put and
Multiplication of the Gaussian likelihood function by the specified prior distribution gives the formal posterior distribution kernel, with respect to and counting measure on ,
There is an empty component under an improper prior at . The sum is independent of , whose prior distribution is flat on all of . For every fixed finite and , the kernel is a strictly positive constant in , hence
The configuration has positive prior probability . Integrating over, for example, a bounded interval of and already makes the joint normalization infinite. Thus the printed prior distribution does not produce a posterior probability distribution. This failure is present for every data set, not just for a special arrangement of observations.
The formal full conditionals expose exactly where the requested sampler breaks. For , completing the two mean squares gives
The variance kernel is that of when , and the discrete conditional probabilities are proportional to . At the conditional kernel for is constant and cannot be normalized; it is not a normal distribution with an infinite variance. Therefore no valid Gibbs sampler, and no value of , exists for the model as printed. A chain that simply substitutes an arbitrary distribution for this missing conditional would be sampling a different model.
Here is a fully specified proper-prior repair retaining the no-change configuration. Choose fixed hyperparameters
independently, with . Its Gaussian change-point posterior with proper priors is
It is normalizable even for degenerate data: the likelihood function is at most , and its integral against the variance prior distribution is bounded by
The normal mean priors integrate to one, and the normalizing constant is positive. This proves posterior propriety for the repaired model.
Completing the conditional squares gives the Gaussian change-point Gibbs updates. Define
The four updates are
At , , giving its proper prior distribution unchanged. Starting from any finite means, positive variance and allowed , cycle through these four updates using the latest values. The sum-of-squares terms can be evaluated from cumulative data sums; normalize the discrete log weights after subtracting their maximum to avoid numerical underflow. The proper positive conditionals allow movement among all split values and throughout the continuous parameter support.
Under this specified repair, is the posterior probability of no change within the observed sequence: all data points belong to the first mean regime. For retained draws after initialization has ceased to affect the estimates, its Markov chain Monte Carlo estimator is
Alternatively average the displayed conditional probability of at the sampled continuous parameters, giving an estimate by Rao-Blackwellization. Autocorrelation must be accounted for in its Monte Carlo uncertainty. These are probabilities and estimators for the explicitly repaired model; the original unnormalizable kernel supplies neither.
For a regular one-parameter sampling distribution, the Fisher information and Jeffreys prior are
Under the usual differentiation and integrability conditions, . This prior distribution transforms as a density under smooth one-to-one reparameterizations, so the rule is coordinate invariant. Its integral need not be finite; posterior propriety must still be established if it is an improper prior.
Let . Bayes' theorem and the stated prior factorization give the posterior density
The normalizing constant, when finite and positive, is the integral of this product over its admissible parameter domain. An improper prior requires checking posterior propriety before interpreting this expression as a probability density.
A log-flat improper prior is not appropriate when all known are positive: the integrated likelihood in (iii) has a positive finite limit as , so its integral against diverges. One defensible noninformative choice is the scalar Jeffreys prior for an additive variance component, calculated holding the mean parameters fixed:
Indeed the normal variance score has information . This is a scalar conditional-information prior, not a claim that its product with the flat mean prior is the joint Jeffreys prior. It is bounded near zero and is at infinity. The integrated likelihood is uniformly bounded near zero and is bounded by a constant times at infinity, independently of the mean-shape parameters, since . Thus and a proper external prior on the physically admissible ensure posterior propriety. Proper weak scale priors are another option. If known errors vanish, the boundary argument and appropriate prior need separate reconsideration.
For an efficient parameterization, use with and . A chain on this joint reduced parameter space targets
The factor is the Jacobian determinant. At each iteration propose , with for a fixed nonsingular proposal covariance, and accept with probability . Proposals outside the physical prior domain have target zero. Tune during warmup and freeze it for the retained random-walk Metropolis algorithm. To obtain samples of the full original parameter vector, independently draw from its retained positive prior and reconstruct ; the resulting vector is . Analytically marginalizing using (iii) would also be valid.
Use several dispersed chains, trace plots, rank-normalized split , and the effective sample size of a Markov chain for each parameter and for . These Markov chain Monte Carlo convergence diagnostics reveal poor mixing and disagreement but do not prove convergence. Estimate the integrated autocorrelation time ; with retained draws, . Default to no thinning of a Markov chain, so the thinning factor is . If storage requires thinning, choose a spacing after inspecting the autocorrelation and verify the retained-chain effective sample size; no finite spacing guarantees independent draws.
Using the retained samples, compute
These are posterior summaries, provided the corresponding moments exist, not uncertainties of the numerical estimates. A proper prior alone does not ensure finite second moments; choose or check the external prior accordingly. The Monte Carlo standard error of the posterior mean is approximately .
Write , and . A flat density in means with respect to ; likewise . The Jacobian determinant must therefore appear when using the original scale variables. The joint hierarchical Bayesian model kernel, with respect to , is
This is a kernel, not a normalized joint probability distribution, because the stated priors are improper. Conditioning on would still require posterior propriety. In fact that check fails here, as shown in part (iii)(c); proper formal full conditionals alone do not repair it. The Gaussian–exponential hierarchical colour model distinguishes the intrinsic normal colour, positive interstellar dust reddening, and measurement noise.
Prior probability Created 2026-09-24 Updated 2026-10-14
Prior probability describes uncertainty before the current observations are incorporated. For a statistical parameter , a prior distribution assigns probabilities to its possible ranges, conditional on background information and a statistical model. A continuous prior density specifies these probabilities through integration:
Here the probability density function is relative to Lebesgue measure ; a discrete prior distribution instead uses a probability mass function and sums. Density at one point is not the probability of that point. A nonnegative kernel with infinite total mass is an improper prior, whose use requires a separate check of posterior propriety.
For the coin model in Bayesian statistics, the beta distribution has prior density on . Its mean is and its variance is . It favors moderate heads probabilities without ruling out values near zero or one. For example,
The prior curve in Bayesian posterior makes this preference visible; moment matching for a beta prior explains how to choose a beta distribution from a desired mean and variance.
A prior distribution lets earlier evidence or elicited knowledge contribute to statistical inference when the current sample size is limited. It also exposes assumptions that can be checked by prior elicitation and a prior predictive check. Before the same eight heads and two tails, a uniform prior would give posterior mean , compared with under : the observations do not uniquely determine a Bayesian posterior. Even a uniform prior makes a choice of parameter coordinates; its child article explains why changing coordinates can destroy uniformity.
For a regular scalar model, let be a smooth invertible change of statistical parameter with nonzero derivative. The chain rule makes the score function in the new coordinate equal to the old score function times . Therefore the expected Fisher information transforms as . Taking its square root gives exactly the absolute change-of-variable factor required for a prior density.
Consequently, computing the Jeffreys prior directly in either coordinate produces the same measure after transformation. Its density is not numerically constant across coordinates, nor must either density be uniform. When the prior distribution is proper, compatible normalization gives identical prior probabilities for corresponding sets; the resulting posterior distributions also transform consistently. For an improper prior the equality concerns measure kernels up to a constant, and posterior propriety still needs checking.