Bayesian deviance 2026-10-06
A Bayesian deviance is minus twice the log-likelihood, with any chosen additive data-only constant held consistent across the models being compared. Its Bayesian posterior expectation measures average fit. In the deviance information criterion, evaluating it at a parameter's posterior mean also enters the effective complexity penalty. This likelihood-based convention differs by a data-only constant from a saturated-model exponential-family deviance when a common saturated model exists.
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.
Bayesian statistics Created 2026-09-24 Updated 2026-10-14
Bayesian statistics expresses uncertainty about an unknown statistical parameter through a probability distribution, then uses Bayes' theorem to update it after observing data. The prior distribution describes uncertainty before the current observations; the likelihood function describes how the statistical model generates those observations at each parameter value; the posterior distribution describes uncertainty conditional on the observations and that model. A physical parameter can have one fixed value while its value remains uncertain to us. Assigning it a probability distribution represents that uncertainty under the chosen model, rather than requiring the physical parameter to change randomly between measurements.
For example, suppose ten Bernoulli trials are independent conditional on an unknown heads probability , with a beta distribution prior . Eight heads and two tails give the posterior distribution by Beta-binomial conjugacy. Its posterior mean is , between the prior mean and observed binomial proportion . The Bayesian posterior below computes the whole update, and the credible interval below summarizes its remaining uncertainty. The conjugate update is explained in MIT 18.05, Reading 15: beta and normal conjugate priors.
The useful feature is that one posterior distribution supports several questions: a posterior mean estimates a value, a credible interval reports a range, and a posterior predictive distribution predicts a future observation while averaging over parameter uncertainty. With conditionally independent new data, today's posterior distribution can become tomorrow's prior distribution. These conclusions remain conditional on the statistical model and prior distribution; a precise update does not establish that either assumption fits the experiment.
A historical starting point is Thomas Bayes's essay in the 1763 volume of the Royal Society's Philosophical Transactions, communicated after his death by Richard Price. Its opening problem asks for uncertainty about an unknown event probability given observed successes and failures: the same direction of reasoning illustrated by the coin example. See Bayes and Price, An Essay towards solving a Problem in the Doctrine of Chances, opening letter and problem.
In the Gamma prior for an inverse-gamma scale model, assume . The variance of hypothetical means is , and the expected process variance is . The Bühlmann credibility factor is , giving the displayed expression. The optimal affine credibility estimate is . Its fixed-weight arithmetic-mean form differs from the reciprocal-based posterior mean.
For , the posterior mean under has constant squared-error risk . Its unique Bayes property and constant risk make it the unique minimax estimator.
For one uniformly sampled integer , the likelihood function for the unknown endpoint is . A flat improper prior on positive integers gives an improper posterior distribution, since the harmonic series diverges. A reciprocal prior instead gives a proper posterior proportional to for , with approximate survival probability and finite quantiles, but infinite posterior mean. A uniform prior cut off at gives posterior mean , demonstrating sensitivity to that arbitrary cutoff.
The DIC effective parameter count compares mean Bayesian deviance with deviance at the posterior mean. It need not be an integer or equal the number of coefficients. Interpretation depends on the parameterization and the chosen observational likelihood; nuisance intercepts count when they appear in that likelihood.
An equal-tailed credible interval uses quantiles of a continuous posterior distribution to leave posterior probability in each tail. It is also called a central credible interval; central refers to equal tail probabilities, not equal distances from the posterior mean. For the beta distribution in credible interval, the 95% endpoints are approximately and , whose midpoint differs from the posterior mean .
With the gamma scale inverse-gamma conjugacy model and prior shape , the Bühlmann model has . Its Bühlmann credibility premium equals , exactly the Bayes estimator under squared error loss of . Equality holds because the posterior mean is already affine in the observed sample mean.
With a Poisson-gamma conjugacy with unequal exposures model, and , so the Bühlmann–Straub credibility factor is . The credibility estimate simplifies to , exactly the posterior mean and hence the Bayes estimator under squared error loss. The agreement is exact because that posterior mean is already affine in the exposure-weighted data.
Gamma rate gamma conjugacy Created 2026-10-07 Updated 2026-10-14
Conditionally independent gamma distributions with known shape and unknown rate have likelihood proportional to . A gamma distribution prior of shape and rate therefore updates to shape and rate . When , the posterior mean of the conditional claim mean is . For and , this is a credibility estimate with weight . It is the reciprocal-rate version of gamma scale inverse-gamma conjugacy.
Gamma scale inverse-gamma conjugacy Created 2026-10-06 Updated 2026-10-07
For conditionally independent gamma distribution observations of known shape and unknown scale , an inverse-gamma distribution prior with shape and scale gives an inverse-gamma distribution posterior with shape and scale . The posterior mean of the conditional claim expected value is when the denominator is positive.
In a linear Gaussian state-space model with process noise covariance and exact scalar observation , the predictive state covariance includes even though there is no separate measurement noise. Here denotes predicted state covariance; it differs from the measurement-noise notation in the general Kalman filter equations. The observation innovation variance is . Omitting the second term incorrectly removes the current process noise. If , Gaussian conditional expectation gives the posterior covariance matrix . This can be a singular matrix because the observed linear combination is then known exactly.
For a concrete example with two state components that are dimensionless quantities, take predicted mean , predicted covariance matrix
and exact observation of the first component, , . The innovation is , its variance is , and the Kalman gain is . The posterior mean and posterior covariance matrix are therefore
The observed component now has zero variance. The second component remains uncertain, but its posterior mean changes and its variance falls from to because its prediction error had nonzero correlation with that of the first. This is the mechanism by which measurements of one component can inform another.
For , with independent and , the multivariate normal distribution of the Bayesian posterior has posterior mean and covariance matrix . The singular value decomposition shows that the variance on a right singular vector of nonzero singular value is , while the variance along the null space is one. Thus, for fixed data, the mean tends to the minimum-norm least-squares solution and the covariance tends to the orthogonal projection onto the null space. Unobserved components retain their prior distribution even as the noise vanishes.
Kalman filter Created 2026-10-03 Updated 2026-10-14
The Kalman filter alternates a Kalman prediction step with a Kalman measurement update. It carries a state estimate forward using a state-space model, then adjusts it by the part of the new observation that was not predicted: the innovation. The Kalman gain determines the adjustment from the uncertainty of the prediction and the measurement noise. A noisy measurement should have less influence than an equally surprising precise one.
For a precise discrete-time statement, let the state and observation be vectors in real vector spaces obeying the linear state-space model
The matrices and control inputs are known. Assume a Gaussian random vector with mean and covariance matrix , and mutually independent centered Gaussian noises , independent of , with covariance matrices . Suppose is positive-definite, so the observation innovation covariance is invertible. Then the recursions below give the exact posterior mean and posterior covariance matrix , hence the full conditional multivariate normal distribution. They also minimize mean squared error. Without the Gaussian assumptions, suitable second-order assumptions still give best affine state estimates, but do not generally give an exact posterior distribution. [ref].
For an exact scalar example, suppose the predicted state has normal distribution and a measurement reports in the same units. With measurement noise variance , the Kalman gain is and the posterior distribution is
With the same prediction and observed value but measurement noise variance , the Kalman gain becomes and the posterior distribution is instead . Both updates move toward the observation; the more precise measurement moves the estimate further and reduces uncertainty more.
Figure 1.
The same observed value produces different Kalman measurement updates when its uncertainty changes
. Both panels start from and observe . The green curve is the likelihood function normalized over the scalar state for this unit-coefficient observation model. The orange curve is the posterior density; its narrower width reflects reduced variance. The vertical dotted line marks the observed value, rather than a known true state. Details.
The useful compression is exact under the stated model: the two objects contain everything from the past observations needed for the next update. Their size depends on the state dimension, not on the length of the observation history. This makes causal state filtering practical when observations arrive continually. It also gives Linear-quadratic-Gaussian control an estimate of the state on which to act.
Rudolf E. Kalman's 1960 paper organized linear filtering around state transitions, error covariance and recursive computation, connecting estimation with optimal regulation. Its introduction acknowledges earlier work by Wiener, Bode, Shannon and others; the useful historical claim is this particular formulation, rather than that estimation began in 1960. [ref].
Consider a local-level state-space model , , with mutually independent centered Gaussian noises of variances and . Start with , independently of these noises. Before the first observation, the Kalman prediction step gives , . If , the Kalman gain is , and the posterior mean and posterior variance become
The next Kalman prediction step keeps the mean but adds fresh process noise variance, giving . If , then
Thus new uncertainty is introduced at each transition and reduced by each measurement. It does not shrink to zero merely because many measurements have arrived: the state continues to change.
Figure 1.
A Kalman filter follows a changing scalar state and retains uncertainty about each new transition
. Top: one seeded synthetic random walk, its noisy observations and the filtered posterior mean, starting from with , . The shaded region is the mean plus or minus two posterior standard deviations, a pointwise conditional band under the stated model. Bottom: the Kalman gain approaches its positive steady value. Setting instead asserts a constant state and eventually stops adapting appreciably. This single generated record illustrates the mechanism; it is not an empirical accuracy study. Details.
The steady-state local-level Kalman gain here is
With , the limiting posterior variance has the same numerical value. By contrast, the static-state model with gives and . That decreasing gain is appropriate for a state that truly remains constant. Applied to the changing random walk, it builds confidence in the wrong model. The choice of process noise is therefore a statement about state evolution, rather than just an instruction to make a plot look smoother.