Mathematics · Article
Bayesian inference and credible intervals
Define posterior uncertainty within a declared joint model. Derive credible sets and conjugate predictions, distinguish credibility from repeated-sampling coverage, and examine prior sensitivity, marginal likelihoods, predictive checks, partial pooling and numerical approximation.
Back to MathematicsAfter reading, you can
- Specify a prior, sampling law, observed-data representation and the normalizing condition for a posterior.
- Construct and interpret credible sets, including skewed, transformed, discrete and disconnected cases.
- Derive beta-binomial, exposure-aware gamma-Poisson and known-variance normal posterior predictions.
- Distinguish parameter credibility, predictive uncertainty, fixed-parameter coverage and prior-averaged calibration.
- Explain how prior support, improper kernels, model probabilities and marginal-likelihood constants affect inference.
- Assess predictive checks, conditional partial pooling and numerical approximations without confusing model uncertainty and computational error.
State which uncertainty the posterior describes
An uncertain process fraction, an unknown sensor mean and the result of a future measurement are different targets. Bayesian inference describes uncertainty about such targets by conditioning a joint probability model on observations. The model must connect the unknown quantities to a particular experiment. A posterior probability is meaningful within that connection; the word Bayesian alone supplies neither a sampling design nor a guarantee that the connection is scientifically adequate.
The earlier Bayes rule lesson established the updating identity and elementary examples. Here use that identity as a starting point. The new questions concern complete posterior distributions, credible sets, predictions, sensitivity and model adequacy. The preceding estimation, interval and testing lessons remain relevant because they distinguish an estimand, a repeated-sampling procedure and an observed result. Keep those distinctions when introducing a posterior distribution.
Begin by naming the parameter, units, data and intended prediction. For a pass fraction p, uncertainty concerns a dimensionless population probability. For a fault rate λ, specify the exposure unit. For a sensor mean μ, distinguish uncertainty about the mean from variability of the next reading. A model can include all these uncertainties, but an interval for one target cannot silently be relabelled as an interval for another.
All numerical examples below are hypothetical. The simple conjugate models allow exact reasoning and transparent checks. Later sections expose their boundaries: support restrictions, improper priors, model comparisons, predictive failures, hierarchical assumptions and approximation error. These boundaries are part of the analysis, rather than exceptions that disappear after a posterior has been computed.
A posterior requires a well-defined joint model
Write Π for a prior probability measure on a parameter space Θ and f(y|θ) for the sampling density or probability mass function relative to a declared data reference measure. For fixed observed y, the function θ↦f(y|θ) is the likelihood. It need not integrate to one over θ. The prior and sampling law together define a joint experiment in which a parameter is drawn from Π and observations follow the conditional sampling law.
In a dominated formulation define m(y)=∫Θ f(y|θ)Π(dθ). If 0<m(y)<∞, the posterior probability of a measurable set A is Π(A|y)=∫A f(y|θ)Π(dθ)/m(y). The denominator is the marginal density or mass of the observed data. It both normalizes this posterior and later enters a comparison of complete models. Check its existence rather than cancelling an unspecified infinity or dividing by a zero likelihood.
A proper prior combined with a valid sampling law gives proper conditional distributions almost everywhere under their joint data law. This is not a promise that every arbitrarily supplied observation has a finite positive normalizing integral. Exceptional observations, incompatible support declarations and an incorrectly specified likelihood still require attention. An impossible count at zero exposure, for example, cannot be repaired by a routine conjugate update.
Likelihood and density values depend on how the observations are represented. A continuous density has inverse measurement units; its numerical value is not the probability of an exact point. Transforming observations requires the appropriate Jacobian. Constants independent of θ can be dropped when normalizing one posterior if they are finite and positive, but retaining them is necessary when computing a marginal likelihood or comparing models on the same observed-data scale.
Choose posterior summaries for a specified purpose
A posterior distribution contains more information than one fitted value. Its mean, median, mode, quantiles and tail probabilities answer different questions. Under squared-error loss and a finite posterior second moment, an action a has posterior expected loss E[(a−θ)²|y]=(a−E[θ|y])²+Var(θ|y). Expanding around the posterior mean proves that this mean minimizes the expected loss. The claim concerns a stated loss and integrability condition, rather than a universal best estimate.
Under absolute-error loss and a finite first absolute posterior moment, a posterior median minimizes expected loss. With atoms or a flat part of the cumulative distribution, a minimizing median need not be unique. A mode instead maximizes a density relative to a chosen coordinate and reference measure; it can be nonunique, unbounded or unattained. A boundary formula derived for an interior mode must not be used outside its domain.
A proper posterior need not have the moments required by a requested summary. A Cauchy posterior has finite total probability and useful quantiles but no finite mean or variance. Reporting its location parameter as its expected value would confuse two different definitions. Likewise, a sampler returning a finite average does not prove that the distribution being sampled has a finite expectation.
Attach the target and units to each summary. The posterior mean of a rate has inverse-time units, while a posterior probability that the rate exceeds a threshold is dimensionless. A posterior mean of a transformed parameter usually differs from transforming the original posterior mean. For instance, E[p²|y] generally differs from E[p|y]²; that difference will become the covariance of two future Bernoulli observations after parameter uncertainty is integrated out.
Define credible probability before choosing endpoints
For 0<α<1, a measurable data-dependent set C(y) is a posterior credible set with credibility at least 1−α when Π(C(y)|y)≥1−α. In a continuous model it is often possible to arrange exact mass 1−α. The probability is conditional on the observed data and the declared model. A statement that a parameter lies in this set with posterior probability 0.95 should name that model and target, rather than suggest unconditional certainty about a scientific claim.
For a real-valued posterior let F(x|y)=Π(θ≤x|y) and define qᵤ=inf{x:F(x|y)≥u}, with 0<u<1. An equal-tail interval uses [q_(α/2),q_(1−α/2)]. With a continuous strictly increasing cumulative distribution it has exact mass 1−α. With atoms or flat portions, use the actual cumulative probabilities, including F just below the lower endpoint. A closed interval can have more than the nominal mass, and changing an endpoint from closed to open can remove a nonzero atom.
Credible sets need not be intervals or connected. If a posterior places mass near two separated parameter regions, a union of intervals can describe that structure more faithfully than one interval spanning a low-probability gap. Discrete masses can prevent an exact target probability for any nonrandomized set. With masses 1/2, 3/10 and 1/5 at three points, no subset has mass 0.95; a set with at least that mass must contain all three.
Quantiles are not interchangeable with standard-deviation bands. A symmetric normal posterior supports a familiar central interval m±z_(1−α/2)√v, but skewed, bounded or multimodal distributions need their own cumulative calculation. Whenever endpoints are rounded for display, the displayed interval may have slightly different mass. Preserve exact definitions and use approximation signs for numerical endpoints.
Equal-tail and highest-density sets have different geometry
A highest-posterior-density region is constructed relative to a specified density coordinate by retaining high-density points down to a threshold, with tie and boundary choices when necessary. It can be disconnected or nonunique. In a one-dimensional continuous case, a highest-density interval can also be a shortest credible interval under appropriate shape conditions. Neither uniqueness nor a single interval follows from the phrase highest density alone.
For a Beta(2,1) posterior on p∈[0,1], density 2p increases and F(p)=p². Its 90% equal-tail interval is [√0.05,√0.95]. Its shortest contiguous 90% interval is [√0.1,1]. To see the latter, an interval [l,u] has mass u²−l²=(u−l)(u+l); for a fixed length, moving it right increases its mass. The shortest interval achieving the target therefore reaches the upper boundary. Both intervals have the same posterior mass but different lengths and tail allocations.
A one-to-one monotone transformation preserves the probability of the transformed set. Increasing transformations also preserve the quantile ordering used by equal-tail intervals. They do not generally preserve density rankings or shortest length: those depend on the coordinate and its Jacobian. With φ=p³, the transformed cumulative distribution is φ^(2/3) and its density is (2/3)φ^(−1/3) on (0,1). This density decreases, whereas the original density increased.
Under this cubic transformation, the original highest-density interval maps to [(0.1)^(3/2),1]. It still has mass 0.9, but the transformed-coordinate highest-density interval is [0,(0.9)^(3/2)], up to zero-mass endpoint choices. Thus credible probability survives the transformation while the highest-density construction changes. Under the alternative transformation φ=p² the law is uniform, making highest-density ties explicit. State the parameter coordinate before comparing credible-set lengths or calling an interval optimal.
φ=p^(1), p~Beta(2,1); credibility=9/10.
Continuous posterior with Fp(p)=p². Coordinate support is[0,1]. The transformed density is(2/r)φ^(2/r−1) on(0,1); no endpoint atom is introduced by a divergent density. Equal-tail quantiles transform. Highest density and shortest length use the chosen coordinate.
| Quantity | Exact value or definition | Approximation | Units | Interpretation |
|---|---|---|---|---|
| Requested credibility | 9/10 | ≈0.9 | probability | Both defined continuous sets have this exact mass |
| Coordinate power | 1 | ≈1 | dimensionless | φ=p^r, an increasing one-to-one transformation on[0,1] |
| Equal-tail length | (1−(1/10)/2)^(1/2)−((1/10)/2)^(1/2) | ≈0.751073 | coordinate units | Length depends on the coordinate |
| Native highest-density interval length | 1−(1/10)^(1/2) | ≈0.683772 | coordinate units | Monotone density puts the shortest interval at a support boundary |
| Mapped original-p HPD length | 1−(1/10)^(1/2) | ≈0.683772 | coordinate units | Mapping preserves mass, not necessarily highest-density geometry |
Exact interval definitions and targets
| Interval | Lower definition | Upper definition | Numerical endpoints | Posterior mass | Target / units |
|---|---|---|---|---|---|
| Equal-tail interval | ((1/10)/2)^(1/2) | (1−(1/10)/2)^(1/2) | [≈0.223606797749979, ≈0.974679434480896] | 9/10 | Transformed coordinate φ; coordinate units |
| Native-coordinate HPD | (1/10)^(1/2) | 1 | [≈0.316227766016838, ≈1] | 9/10 | Density in the φ coordinate; coordinate units |
| Image of original-p HPD | (1/10)^(1/2) | 1 | [≈0.316227766016838, ≈1] | 9/10 | Mapped set; still credible; coordinate units |
Exact fractions, interval definitions, units and raw model inputs are preserved. Values marked ≈ are numerical approximations; short graph labels use six significant digits. Finite plotted grids join evaluated coordinates as guides, without claiming exact interpolation. Numerical rounding to zero or one does not itself establish impossibility or certainty. Posterior credibility, prediction and repeated-sampling coverage keep their stated conditioning and targets.
Use the beta update with its full parameter domain
Let p have Beta(a,b) prior density p^(a−1)(1−p)^(b−1)/B(a,b), where a,b>0 and B(a,b)=∫₀¹ p^(a−1)(1−p)^(b−1)dp. For n fixed conditionally independent Bernoulli trials with common p and k passes, n is a nonnegative integer and 0≤k≤n. Multiplication by the likelihood gives posterior shapes A=a+k and B=b+n−k. The symbol B used as a shape in this paragraph is distinct from the beta function B(·,·).
The posterior is Beta(A,B), with mean A/(A+B) and variance AB/[(A+B)²(A+B+1)]. One way to derive the mean is B(A+1,B)/B(A,B)=A/(A+B); using the corresponding second-moment ratio gives the variance. An interior mode (A−1)/(A+B−2) requires A,B>1. If a shape is at or below one, inspect the boundary behavior instead of forcing this interior expression.
Positive noninteger shapes are valid. Their interpretation does not require inventing a literal count of past physical observations. The prior contributes exponents to a mathematical model; its scientific justification may involve previous evidence, plausible scales or an elicited distribution. Adding one to both observed counts is the consequence of the particular uniform Beta(1,1) prior, rather than a prior-free Bayesian rule.
For a Beta(2,2) prior and six passes in eight checks the posterior is Beta(8,4). Its mean is 2/3, mode 7/10 and variance 2/117. The 95% equal-tail endpoints are defined by the beta cumulative distribution at 0.025 and 0.975, approximately 0.39025744 and 0.89073656. Neither the mean nor the mode substitutes for this uncertainty statement, and neither proves that the pass fraction is constant across an altered process or sampling design.
Prediction integrates parameter uncertainty
Suppose K is the count of passes in m future trials that are independent conditional on the same p. With posterior Beta(A,B), integrate their Binomial(m,p) law: P(K=j|y)=C(m,j)B(A+j,B+m−j)/B(A,B), for j=0,…,m. Here m is a nonnegative integer. This predictive beta-binomial distribution describes future counts; the name is distinct from using beta and binomial as a conjugate prior-likelihood pair.
The probabilities sum to one because integrating Σⱼ C(m,j)pʲ(1−p)^(m−j)=1 against a probability posterior leaves one. Write s=A+B. Total expectation gives E[K|y]=mA/s. Total variance gives Var(K|y)=E[mp(1−p)|y]+Var(mp|y)=mAB(s+m)/[s²(s+1)]. The first term averages ordinary binomial variability and the second retains uncertainty about the common pass fraction.
For two distinct future indicators Y₁,Y₂, conditional independence gives E[Y₁Y₂|y]=E[p²|y], so Cov(Y₁,Y₂|y)=Var(p|y)>0 for a nondegenerate beta posterior. They are conditionally independent given p and generally dependent after p has been integrated out. Replacing p by its posterior mean in a binomial count loses this component. Parameter uncertainty creates predictive dependence even though no direct interaction between future trials has been asserted.
Posterior Beta(A=8,B=4); m=3.
The future trials are conditionally iid Bernoulli with the same uncertain p represented by this proper posterior. All counts0..m are included with exact rational masses, including m=0. The plug-in law is a comparison, not a posterior predictive replacement.
| Quantity | Exact value or definition | Approximation | Units | Interpretation |
|---|---|---|---|---|
| Posterior mean p | 2/3 | ≈0.666667 | probability parameter | Same mean used by the plug-in comparison |
| Posterior variance p | 2/117 | ≈0.017094 | squared probability-parameter units | Nonzero parameter uncertainty |
| Predictive count mean | 2 | ≈2 | passes | m A/(A+B) |
| Predictive count variance | 10/13 | ≈0.769231 | squared counts | Total variance retains uncertainty about the shared p |
| Plug-in binomial variance | 2/3 | ≈0.666667 | squared counts | Treats the posterior mean as a fixed known p |
| Extra predictive variance | 4/39 | ≈0.102564 | squared counts | m(m−1)Var(p|data) |
| Covariance of distinct future indicators | 2/117 | ≈0.017094 | squared indicator units | Conditional independence does not survive integration over the common p |
Every finite outcome or scenario
| Count | Exact predictive mass | Approximation | Exact plug-in mass | Approximation |
|---|---|---|---|---|
| 0 | 5/91 | ≈0.0549451 | 1/27 | ≈0.037037 |
| 1 | 20/91 | ≈0.21978 | 2/9 | ≈0.222222 |
| 2 | 36/91 | ≈0.395604 | 4/9 | ≈0.444444 |
| 3 | 30/91 | ≈0.32967 | 8/27 | ≈0.296296 |
Exact fractions, interval definitions, units and raw model inputs are preserved. Values marked ≈ are numerical approximations; short graph labels use six significant digits. Finite plotted grids join evaluated coordinates as guides, without claiming exact interpolation. Numerical rounding to zero or one does not itself establish impossibility or certainty. Posterior credibility, prediction and repeated-sampling coverage keep their stated conditioning and targets.
After the Beta(8,4) update, three future trials have probabilities (5,20,36,30)/91 at counts 0,1,2,3. Their predictive mean is 2 and variance 10/13. The plug-in Binomial(3,2/3) has the same mean but variance 2/3, smaller by 4/39. Matching a mean therefore does not establish that two predictive distributions describe the same uncertainty. Changed future conditions would require a different conditional model as well.
Carry exposure and units through a rate update
Use Gamma(a,b) in the shape-rate convention: its density for λ>0 is bᵃλ^(a−1)e^(−bλ)/Γ(a), where a,b>0. For λ measured per hour, b has hours as its unit, the mean a/b is per hour and variance a/b² is per squared hour. A shape-scale convention would use a different second parameter. Name the convention before updating or comparing numerical values.
For independent counts Yᵢ|λ∼Poisson(tᵢλ) at fixed recorded exposures tᵢ>0, let S=Σyᵢ and T=Σtᵢ. The likelihood is [∏tᵢ^(yᵢ)/yᵢ!]λˢe^(−Tλ), with yᵢ nonnegative integers. Combining its kernel with the prior yields Gamma(a+S,b+T). Exposures enter the rate parameter through their total, while the original exposure/count constants remain relevant to the probability of this particular observed count vector.
Integrating the complete likelihood gives m(y)=[∏tᵢ^(yᵢ)/yᵢ!] bᵃΓ(a+S)/[Γ(a)(b+T)^(a+S)]. This is a probability mass for the labelled count vector conditional on the recorded exposures. It is not automatically the probability of the aggregated total under a different data representation. Such aggregation changes the combinatorial factors, although the posterior kernel for λ can be the same.
For prior Gamma(2,1 hour), counts (1,0,3) over exposures (1/2,1,3/2) hours give S=4 and T=3 hours. The posterior is Gamma(6,4 hours), with mean 3/2 per hour and variance 3/8 per squared hour. The probability of that count vector is 135/16384. If exposure is zero, the Poisson mean is zero and the only possible count is zero; a positive observed count then contradicts this model rather than adding ordinary information about λ.
A future count and a rate have different distributions
For posterior λ|y∼Gamma(A,B) in the shape-rate convention and a future fixed exposure t>0, integrate Poisson(tλ). The result is P(K=j|y)=Γ(A+j)/[Γ(A)j!]·[B/(B+t)]ᴬ[t/(B+t)]ʲ, for j=0,1,… . It is a negative-binomial count distribution with the convention explicitly defined by this formula. Positive real A is allowed; a literal stopping-time story involving an integer number of successes is not needed to define it.
The mixture construction proves normalization without truncating the infinite count support. Its mean is tA/B and variance tA/B+t²A/B². The first term is the average conditional Poisson variance and the second is the variance of the conditional mean. For t=0 the future count is instead a point mass at zero. A drawn count plot covering only finitely many j must display or bound its omitted tail rather than pretend the support ends at the last tick.
Rate intervals come from the gamma posterior for λ, rather than from this count law. For A=1, the posterior is exponential with Fλ(x)=1−e^(−Bx) for x≥0. Its 90% interval starting at the lower boundary is [0,ln(10)/B], while its central 90% interval is [−ln(0.95)/B,−ln(0.05)/B]. Both describe a rate in inverse-time units. The first interval is a highest-density choice because the density decreases away from the boundary.
An interval including zero does not give an exponential posterior a point mass at zero. It includes a single zero-probability endpoint. A model allowing a genuine no-fault state with positive probability would need an atom in its prior/model structure. Distinguish that question from reporting a positive rate whose credible interval approaches zero. The same distinction matters whenever a continuous posterior is used to discuss an exact point hypothesis.
Derive the normal posterior with known observation variance
Let μ∼N(m₀,τ₀²), with τ₀²>0, and let Y₁,…,Yₙ conditional on μ be independent N(μ,σ²) observations with known σ²>0. Throughout this lesson the second argument of N denotes variance, not standard deviation. For n≥1, the likelihood depends on μ through Σ(yᵢ−μ)²=n(μ−ȳ)²+Σ(yᵢ−ȳ)². Only the first term affects the posterior shape for μ.
Combining this quadratic with (μ−m₀)²/τ₀² from the prior gives posterior variance v=(1/τ₀²+n/σ²)^(−1) and mean m=v(m₀/τ₀²+nȳ/σ²). The coefficient of μ² is 1/v and the linear coefficient is −2m/v. Completing the square therefore yields μ|y∼N(m,v), with positive finite v. Prior and sampling precisions add because both quadratics use the same parameter and measurement scale.
The mean can be written as a weighted average of m₀ and ȳ, with weights proportional to their precisions. A prior variance has squared measurement units, so precision has inverse squared units and m retains the original units. The sum formulation m=v(m₀/τ₀²+Σyᵢ/σ²) also handles n=0 using an empty sum: the posterior is then the prior. Do not use an undefined sample mean for an empty sample.
A zero prior variance is a separate point-mass prior, rather than a number to insert into 1/τ₀². Unknown observation variance needs a joint model for μ and σ and integration over its posterior. Replacing the known σ in these equations by a sample standard deviation does not preserve their exact normal-posterior justification. Correlated observations likewise need their actual covariance likelihood, not an independent-data precision count.
Prediction adds the variability of a new experiment
Under the preceding model, a future independent reading has Ynew|μ∼N(μ,σ²). Integrating over μ|y∼N(m,v) gives Ynew|y∼N(m,σ²+v). Total expectation gives m, while total variance adds E[Var(Ynew|μ,y)|y]=σ² and Var(E[Ynew|μ,y]|y)=v. Normal convolution identifies the full predictive law as well as its moments.
A central 95% credible interval for μ is m±z₀.₉₇₅√v. The corresponding predictive interval for one new reading is m±z₀.₉₇₅√(σ²+v), which is wider when σ²>0. For the average of r≥1 new independent readings from the same μ, replace σ² by σ²/r. These are separate prediction targets; the variance for a single observation must not be relabelled as the variance for a future average.
m0=10 mm; τ0²=4 mm²; σ²=9 mm². n=4; sum(y)=52 mm; r=4; level=19/20.
Proper normal prior with positive variance; known positive observation variance, each N second argument is variance. Observations are conditionally iid given μ. Future readings are conditionally independent of the observed sample with the same μ. Prediction is not a population-content tolerance guarantee; unknown variance or dependent observations need another model.
| Quantity | Exact value or definition | Approximation | Units | Interpretation |
|---|---|---|---|---|
| Posterior mean | 298/25 | ≈11.92 | mm | Precision-weighted center; empty data returns the prior |
| Posterior parameter variance | 36/25 | ≈1.44 | mm² | Uncertainty about the common mean |
| Next-reading variance | 261/25 | ≈10.44 | mm² | Adds the known observation variance |
| Future-average variance | 369/100 | ≈3.69 | mm² | Adds σ²/4, not σ² |
| Future-average variance limit | 36/25 | ≈1.44 | mm² | As future average size grows, shared mean uncertainty remains |
| Observed sample mean | 13 | ≈13 | mm | Data summary, not the unknown population mean |
Exact interval definitions and targets
| Interval | Lower definition | Upper definition | Numerical endpoints | Posterior mass | Target / units |
|---|---|---|---|---|---|
| Posterior parameter μ | (298/25)−z_((1+19/20)/2)√(36/25) | (298/25)+z_((1+19/20)/2)√(36/25) | [≈9.56804321855194, ≈14.2719567814481] | 19/20 | Common mean μ; mm |
| One future reading | (298/25)−z_((1+19/20)/2)√(261/25) | (298/25)+z_((1+19/20)/2)√(261/25) | [≈5.58716255632228, ≈18.2528374436777] | 19/20 | Future observation from the same μ; mm |
| Average of 4 future readings | (298/25)−z_((1+19/20)/2)√(369/100) | (298/25)+z_((1+19/20)/2)√(369/100) | [≈8.15503213182884, ≈15.6849678681712] | 19/20 | Future average from the same μ; mm |
Exact fractions, interval definitions, units and raw model inputs are preserved. Values marked ≈ are numerical approximations; short graph labels use six significant digits. Finite plotted grids join evaluated coordinates as guides, without claiming exact interpolation. Numerical rounding to zero or one does not itself establish impossibility or certainty. Posterior credibility, prediction and repeated-sampling coverage keep their stated conditioning and targets.
For prior N(10,4 mm²), four independent readings with mean 13 mm and known observation variance 9 mm² give posterior N(298/25 mm,36/25 mm²). The mean credible interval is approximately [9.56804,14.27196] mm. One future reading instead has variance 261/25 mm² and a central predictive interval approximately [5.58716,18.25284] mm. Different widths arise from different targets, rather than competing calculations of one interval.
A predictive interval for a future observation is also different from a tolerance statement about a specified fraction of an entire population. Neither a posterior interval nor a predictive interval accounts automatically for an unmodelled calibration offset, a changed instrument or selection of unusually stable readings. These effects belong in the scientific observation model. More decimal places in the conjugate calculation cannot represent uncertainty that the model omits.
Separate credibility, coverage and prior-averaged calibration
For an observed y, credibility is Π(C(y)|y). For a fixed parameter θ, repeated-sampling coverage is c(θ)=Pθ{θ∈C(Y)}, with the data and the resulting set changing across experiments. These condition on different things. A rule with 95% posterior mass at every relevant y need not cover every fixed θ in 95% of repeated experiments. Conversely, a confidence procedure calibrated for fixed θ need not have a specified posterior mass under an arbitrary prior.
There is an exact relationship when a proper joint model is used. For jointly measurable C and posterior mass 1−α for almost every y, integrate its indicator in either order: ∫c(θ)Π(dθ)=E[1{θ∈C(Y)}]=E[Π(C(Y)|Y)]=1−α. Nonnegative integration justifies exchanging the order. If posterior mass is at least the target, the prior-averaged coverage is at least the target. The equality averages over the declared prior, rather than establishing equality at every fixed θ.
A transparent counterexample uses μ∼N(0,1) and one Y|μ∼N(μ,1). The posterior is N(Y/2,1/2), so its central 95% interval is Y/2±z₀.₉₇₅/√2. It contains a fixed μ precisely when Y lies between 2μ−z₀.₉₇₅√2 and 2μ+z₀.₉₇₅√2. Since Y−μ is standard normal under that fixed μ, coverage is c(μ)=Φ(μ+z₀.₉₇₅√2)−Φ(μ−z₀.₉₇₅√2).
Prior μ~N(0,1), Y|μ~N(μ,1); true μ=3; observed Y=3; level=19/20.
This illustration fixes the proper joint normal model and the interval rule for every Y. Posterior credibility, fixed-parameter coverage and averaging over the prior condition on different objects. The prior-average identity uses measurability and a proper joint probability law, not a simulated quota.
| Quantity | Exact value or definition | Approximation | Units | Interpretation |
|---|---|---|---|---|
| Posterior credibility | 19/20 | ≈0.95 | probability | Conditional on the observed Y under the declared joint model |
| Fixed-μ coverage | Φ((3)+z_((1+19/20)/2)√2)−Φ((3)−z_((1+19/20)/2)√2) | ≈0.409748 | probability | Repeated sampling with μ fixed; Y and its interval vary |
| Proper-prior averaged coverage | 19/20 | ≈0.95 | probability | Integral of c(μ) against N(0,1), by the joint-model indicator identity |
| Observed posterior mean | 3/2 | ≈1.5 | standardized measurement units | Y/2 for this one-observation model |
| Observed posterior variance | 1/2 | ≈0.5 | squared standardized units | Parameter uncertainty after this Y |
Exact interval definitions and targets
| Interval | Lower definition | Upper definition | Numerical endpoints | Posterior mass | Target / units |
|---|---|---|---|---|---|
| Observed posterior interval | (3/2)−z_((1+19/20)/2)√(1/2) | (3/2)+z_((1+19/20)/2)√(1/2) | [≈0.114096175650324, ≈2.88590382434968] | 19/20 | Parameter μ conditional on observed Y; standardized units |
Exact fractions, interval definitions, units and raw model inputs are preserved. Values marked ≈ are numerical approximations; short graph labels use six significant digits. Finite plotted grids join evaluated coordinates as guides, without claiming exact interpolation. Numerical rounding to zero or one does not itself establish impossibility or certainty. Posterior credibility, prediction and repeated-sampling coverage keep their stated conditioning and targets.
This coverage is approximately 0.9944254 at μ=0 and 0.40974835 at μ=3. The prior-averaged value is still exactly 0.95 under the assumed joint model. The example demonstrates the distinct calibration targets with an analytic calculation. It does not say that all Bayesian intervals have poor fixed-parameter coverage or that one kind of probability can replace another without specifying the scientific reporting question.
Justify priors through the measurement problem
A prior describes uncertainty before conditioning on the particular data used in this update. It can incorporate previous studies, physical constraints, plausible effect scales or structured information about related groups. Its meaning depends on the parameter coordinate: a distribution uniform in p is not uniform in log[p/(1−p)]. Specify support, units and scale before calling a prior weak or informative.
The prior predictive distribution m(y)=∫f(y|θ)Π(dθ) translates parameter assumptions into possible observations under the proposed design. It can expose a scale choice that puts substantial mass on impossible instrument readings or implausibly large counts. Check outcomes that matter scientifically, including extremes, variability, empty groups or dependence patterns. A prior with broad parameter support can still imply concentrated or surprising observable predictions after transformation.
The likelihood must also describe how the observations were obtained. Known exposure, repeated measurements, censoring, missing records, inclusion rules and stopping can change the relevant probability law. Conditioning on a design variable is appropriate when that conditional experiment is intended; ignoring a parameter-dependent selection mechanism is another assumption. A calculation based only on the convenient visible rows is not validated merely because its algebra has a conjugate form.
Using the current data to tune a prior and then treating it as fixed external information can hide a second use of those data. Empirical Bayes and hierarchical methods have explicit roles for such estimation, but their uncertainty and design must be reported. Preserve the rationale for the prior and the analysis choices so that readers can distinguish information supplied by the model from information supplied by this experiment.
Check sensitivity instead of assuming the prior disappears
Compare plausible priors under the same data representation and sampling likelihood. Six passes in eight checks give Beta(7,3) from a uniform Beta(1,1) prior and Beta(26,22) from a Beta(20,20) prior. Their means are 7/10 and 13/24. The posterior probabilities p>1/2 are 233/256 and 3166451366045/4398046511104 respectively. These different answers identify a sensitivity worth discussing, rather than an arithmetic disagreement to conceal.
Prior support is a substantive constraint. If a measurable region A has Π(A)=0 and the posterior update is well-defined, its posterior probability remains zero. Data cannot supply positive posterior mass to a whole excluded region through multiplication by the likelihood. Continuous priors also assign zero probability to individual points while allowing concentration in their neighborhoods; that ordinary feature is different from excluding all plausible neighborhoods of a parameter value.
Identical Binomial(n=8,p) likelihood with k=6; Prior1: Beta(1,1); Prior2: Beta(20,20).
Fixed count of conditionally iid Bernoulli observations with one common p; both priors use the same observation representation. All beta priors are proper with positive shapes. Lower-half priors are explicitly normalized restrictions, not full-beta updates. A support exclusion cannot be reversed by multiplying by this likelihood. A positive-pass observation under a point-zero prior has no posterior. CDF curves join61 numerical evaluations; the plotted heights are not used as unweighted integration cells.
| Quantity | Exact value or definition | Approximation | Units | Interpretation |
|---|---|---|---|---|
| Prior1: posterior mean | 7/10 | ≈0.7 | probability parameter | Updated under the identical n,k common-p likelihood |
| Prior1: posterior variance | 21/1100 | ≈0.0190909 | squared probability-parameter units | Conditional spread; realized variance need not decrease |
| Prior1: P(p>1/2|data) | 233/256 | ≈0.910156 | probability | Exact finite-sum tail for integer posterior shapes |
| Prior1: prior variance | 1/12 | ≈0.0833333 | squared probability-parameter units | For comparison with the realized posterior variance |
| Prior2: posterior mean | 13/24 | ≈0.541667 | probability parameter | Updated under the identical n,k common-p likelihood |
| Prior2: posterior variance | 143/28224 | ≈0.00506661 | squared probability-parameter units | Conditional spread; realized variance need not decrease |
| Prior2: P(p>1/2|data) | 3166451366045/4398046511104 | ≈0.719968 | probability | Exact finite-sum tail for integer posterior shapes |
| Prior2: prior variance | 1/164 | ≈0.00609756 | squared probability-parameter units | For comparison with the realized posterior variance |
Every finite outcome or scenario
| Scenario | Prior | Posterior kernel / normalized law | Normalizer condition | Posterior support |
|---|---|---|---|---|
| 1 | Beta(1,1) | Beta(7,3) | 1 | [0,1] |
| 2 | Beta(20,20) | Beta(26,22) | 1 | [0,1] |
Exact fractions, interval definitions, units and raw model inputs are preserved. Values marked ≈ are numerical approximations; short graph labels use six significant digits. Finite plotted grids join evaluated coordinates as guides, without claiming exact interpolation. Numerical rounding to zero or one does not itself establish impossibility or certainty. Posterior credibility, prediction and repeated-sampling coverage keep their stated conditioning and targets.
More data do not unconditionally remove prior influence or reduce every realized posterior variance. With a Beta(1,100) prior, one pass changes the posterior to Beta(2,100). Its variance 200/(102²·103) exceeds the prior variance 100/(101²·102). Under a proper joint model with a finite parameter second moment, total variance nevertheless gives Var(θ)=E[Var(θ|Y)]+Var(E[θ|Y]), so expected posterior variance is no larger than prior variance. An average statement and a statement about each realized data set are different.
In identifiable, appropriately specified models, accumulating suitable information often makes a range of reasonable priors less influential for some targets. That expectation needs its conditions. Nonidentifiability, excluded support, dependence, a moving data-generating process or a misspecified observation model can leave it inapplicable. A narrow posterior can reflect strong assumptions as well as strong information. Examine scientific consequences of plausible likelihood and prior alternatives, not only the width of one fitted interval.
An improper kernel is not a probability prior
A kernel that cannot be normalized over its parameter space is an improper prior, not a prior probability measure. It can sometimes lead to a proper posterior, but posterior integrability must be checked separately. The conditional formulas for one analysis do not retroactively turn its original kernel into a probability distribution with a unique marginal data probability.
The Haldane kernel 1/[p(1−p)] on (0,1) gives posterior kernel p^(k−1)(1−p)^(n−k−1) after k passes in n common-p Bernoulli trials. The integral is finite exactly when 0<k<n. For k=2,n=5 it yields proper Beta(2,3). For k=0,n=5 the integral diverges near zero. Writing Beta(0,5) in a software label does not make it a defined beta probability distribution.
An arbitrary multiplicative constant illustrates the evidence problem. For one standardized N(μ,1) observation y, a flat prior kernel c>0 over the real μ line yields the normalized N(y,1) posterior for every c. Its formal likelihood integral is c. The posterior cancellation therefore leaves an arbitrary constant in any attempted marginal-likelihood comparison. Proper posterior uncertainty by itself does not determine a unique Bayes factor from this improper kernel.
Specialized model-comparison constructions can address common nuisance parameters under additional conventions. This elementary lesson uses fully specified proper model priors for marginal-likelihood comparisons. Within any method, retain the actual normalizing and moment conditions. A computer returning finite draws or a finite conditional ratio does not prove that an underlying joint distribution, evidence integral or requested posterior mean exists.
A Bayes factor compares complete predictive models
For a choice restricted to two models M₀,M₁, with prior probabilities π₀,π₁>0 and π₀+π₁=1, let m₀(y),m₁(y) be their marginal data densities. Define BF₁₀=m₁(y)/m₀(y) when 0<m₀(y)<∞ and 0≤m₁(y)<∞. Posterior model odds equal BF₁₀·π₁/π₀. Convert odds o to probability o/(1+o). The Bayes factor is not itself a posterior model probability; model prior odds remain part of that calculation.
Both marginal likelihoods must use the same observed-data reference measure and full model specification. Finite positive constants common to both can cancel, but a constant that differs between models cannot be discarded merely because it is independent of a parameter inside one model. Continuous density units cancel in a valid ratio on the same observation scale. Proper changes of parameter coordinates also require their Jacobians, preserving the corresponding model probabilities.
For one standardized Y|μ∼N(μ,1), compare M₀:μ=0 with M₁:μ∼N(0,τ²), τ>0. Under M₁ the marginal observation is N(0,1+τ²). Thus BF₁₀=(1+τ²)^(−1/2)exp[y²τ²/{2(1+τ²)}]. At y=2 this is approximately 1.92212,0.720823 and 0.0738721 for τ=1,10,100. The data are unchanged; spreading the alternative prior changes its predictive probability density at those data.
A continuous posterior having probability zero at μ=0 does not establish that a point-null model has posterior probability zero. A point hypothesis must have a separate model prior or a genuine spike in a mixture when that probability is the scientific target. Nor does a Bayes factor automatically guarantee a chosen repeated-sampling error rate, practical importance or immunity to selective analysis. State the model, prior odds, data collection and reporting target alongside it.
Compare the model with scientifically relevant replications
The posterior predictive distribution is p(yrep|y)=∫f(yrep|θ)Π(dθ|y), with the replication design specified. Generate θ from the posterior and then a replicated data set conditional on θ using that design. A replication with the original exposures, group sizes or missingness pattern asks a different question from a future experiment with changed conditions. Say which experiment is being represented.
Choose discrepancies that can reveal meaningful failures: count variability, extremes, asymmetry, serial dependence, group differences or patterns of zeros. Comparing only an overall mean may miss a model that fits that mean while badly understating dispersion or dependence. Graphical checks and numerical discrepancy summaries can reveal mismatches; neither establishes that the model is true or that all relevant failures have been tested.
A posterior predictive tail probability such as P{T(Yrep)≥T(y)|y} uses a posterior fitted to y. It is generally not a p-value with a uniform distribution under a fixed null parameter. Its reference experiment and data reuse differ from the calibrated tests in the testing lesson. Discreteness and ties also matter. For a uniform p prior and two passes in two checks, the posterior predictive probability of two passes in another two checks is E[p²|y]=3/5, not a posterior probability that a null model is correct.
Prior predictive checks examine implications before fitting this data set, while held-out predictive checks evaluate predictions for observations withheld from that fit. They answer related but different questions. A discrepancy should lead to scientific investigation and a transparent model revision where justified. Repeatedly searching for a favorable check and suppressing failures undermines what the check can tell a reader.
Partial pooling has assumptions and another layer of uncertainty
A simple hierarchical model uses θⱼ|m₀,τ²∼N(m₀,τ²) independently across groups and Yᵢⱼ|θⱼ∼N(θⱼ,σ²) independently within and across groups conditional on their parameters. For the following calculation treat m₀,τ²,σ² as known, with positive variances. Group exchangeability is a modelling judgment about the group parameters, not a claim that the observed group means or their sample sizes are identical.
For group j with nⱼ≥1 and observed mean ȳⱼ, the conditional posterior variance is vⱼ=(1/τ²+nⱼ/σ²)^(−1) and mean mⱼ=m₀+wⱼ(ȳⱼ−m₀), where wⱼ=nⱼτ²/(σ²+nⱼτ²). Smaller groups have smaller wⱼ and are pulled more toward the declared group-population mean. The calculation uses prior group structure; with these hyperparameters fixed, it does not estimate their uncertainty or learn them afresh from the other groups.
Known m0=10 mm; τ²=4 mm²; σ²=9 mm². Group means=16,16 mm; counts=1,9; credibility=19/20.
Group parameters are iid N(m0,tau²) conditional on these known hyperparameters. Within and across groups, observations are conditionally independent N(θj,σ²) with the stated common known positive variance. These are conditional normal calculations, not a fit or integration over unknown hyperparameters. A new group brings between-group uncertainty. Exchangeability and appropriate pooling remain scientific assumptions, not causal comparability guarantees.
| Quantity | Exact value or definition | Approximation | Units | Interpretation |
|---|---|---|---|---|
| Group1: data weight | 4/13 | ≈0.307692 | dimensionless | Fixed-hyperparameter conditional weight, not a fitted hyperparameter |
| Group1: posterior mean | 154/13 | ≈11.8462 | mm | Between the fixed group-population mean and raw observed group mean |
| Group1: parameter variance | 36/13 | ≈2.76923 | mm² | Conditional on known m0,tau²,sigma² |
| Group1: existing-group reading variance | 153/13 | ≈11.7692 | mm² | σ²+vj for another observation in this same existing group |
| Group2: data weight | 4/5 | ≈0.8 | dimensionless | Fixed-hyperparameter conditional weight, not a fitted hyperparameter |
| Group2: posterior mean | 74/5 | ≈14.8 | mm | Between the fixed group-population mean and raw observed group mean |
| Group2: parameter variance | 4/5 | ≈0.8 | mm² | Conditional on known m0,tau²,sigma² |
| Group2: existing-group reading variance | 49/5 | ≈9.8 | mm² | σ²+vj for another observation in this same existing group |
| New-group parameter mean | 10 | ≈10 | mm | Known fixed group-population mean |
| New-group parameter variance | 4 | ≈4 | mm² | A new group has not supplied its own observations |
| New-group reading variance | 13 | ≈13 | mm² | Between-group plus observation variance |
Exact interval definitions and targets
| Interval | Lower definition | Upper definition | Numerical endpoints | Posterior mass | Target / units |
|---|---|---|---|---|---|
| Group1 parameter θ1; n=1 | (154/13)−z_((1+19/20)/2)√(36/13) | (154/13)+z_((1+19/20)/2)√(36/13) | [≈8.5845766256976, ≈15.1077310666101] | 19/20 | Existing-group parameter θ1; mm |
| New reading in existing group1 | (154/13)−z_((1+19/20)/2)√(153/13) | (154/13)+z_((1+19/20)/2)√(153/13) | [≈5.12224015312907, ≈18.5700675391786] | 19/20 | Future reading sharing θ1; mm |
| Group2 parameter θ2; n=9 | (74/5)−z_((1+19/20)/2)√(4/5) | (74/5)+z_((1+19/20)/2)√(4/5) | [≈13.0469549188468, ≈16.5530450811532] | 19/20 | Existing-group parameter θ2; mm |
| New reading in existing group2 | (74/5)−z_((1+19/20)/2)√(49/5) | (74/5)+z_((1+19/20)/2)√(49/5) | [≈8.66434221596394, ≈20.9356577840361] | 19/20 | Future reading sharing θ2; mm |
| Reading in a genuinely new group | (10)−z_((1+19/20)/2)√(13) | (10)+z_((1+19/20)/2)√(13) | [≈2.93324935567814, ≈17.0667506443219] | 19/20 | New group parameter drawn from the fixed group distribution; mm |
Exact fractions, interval definitions, units and raw model inputs are preserved. Values marked ≈ are numerical approximations; short graph labels use six significant digits. Finite plotted grids join evaluated coordinates as guides, without claiming exact interpolation. Numerical rounding to zero or one does not itself establish impossibility or certainty. Posterior credibility, prediction and repeated-sampling coverage keep their stated conditioning and targets.
In a fully Bayesian hierarchy, assign justified priors to unknown hyperparameters and integrate their posterior uncertainty. Provided E[θⱼ²|y]<∞, total posterior variance is E[Var(θⱼ|hyperparameters,y)|y]+Var(E[θⱼ|hyperparameters,y]|y). The first term averages conditional variances over the posterior of the hyperparameters; the second measures variation of the conditional means. Keeping that averaged first term while omitting the second loses a nonnegative variance component. Evaluating Var(θⱼ|ĥ,y) at fitted hyperparameters ĥ is a separate plug-in calculation and generally does not equal the averaged first term. Its equality with, or ordering relative to, the full posterior variance cannot be assumed. Label the conditioning and approximation rather than presenting a fitted-constant variance as the integrated answer.
An existing group has its own posterior θⱼ, while a genuinely new group requires another draw from the group-level distribution and includes between-group variation. Pooling can improve estimation under an appropriate shared model, but it can also obscure real scientific heterogeneity when that model is unsuitable. A common hierarchy does not establish causal comparability, remove measurement differences or justify pooling groups selected by an unmodelled mechanism.
A posterior need not stay in one named family
Conjugacy is an algebraic convenience: a chosen prior and likelihood leave the posterior in a tractable family. A scientifically appropriate prior or observation model need not be conjugate. The posterior identity still applies whenever its normalizing condition is satisfied. A finite mixture sometimes remains exactly tractable even when it cannot be represented by one member of the elementary conjugate family.
For prior Π=ΣᵣwᵣΠᵣ with nonnegative weights summing to one, let mᵣ(y)=∫f(y|θ)Πᵣ(dθ). If the combined finite evidence is positive, posterior component weights are wᵣmᵣ(y)/Σₛwₛmₛ(y). Each component posterior is updated within its own prior where its evidence is positive. Components with zero joint weight at the observed data contribute no posterior mass. The component evidences must be retained; simply keeping the prior mixture weights does not perform the update.
For half Beta(1,4) plus half Beta(4,1), one pass has evidence (1/2)(1/5)+(1/2)(4/5)=1/2. The posterior is (1/5)Beta(2,4)+(4/5)Beta(5,1). Its mean is 11/15 and its cumulative probability at p=1/2 is 3/16. Averaging the component shape parameters would describe a different distribution and does not preserve these probabilities in general.
Mixtures can represent separated scientific possibilities or multiple posterior modes, although a mixture is not automatically multimodal. Preserve its actual component weights and cumulative probabilities. A continuous mixture of continuous component densities still has zero probability at each individual point. Introducing an exact-point hypothesis requires a corresponding atom or model component, not merely a tall density near that point.
Numerical accuracy is distinct from posterior uncertainty
When exact integration is unavailable, a numerical approximation adds a second source of uncertainty or error. A deterministic grid must approximate integrals with cell weights, an appropriate domain and support or tail treatment. Normalizing density heights on a nonuniform grid without widths is not automatically an approximation to the intended probability distribution. A finite sum equal to one establishes normalization of that sum, rather than accuracy of its approximation.
Use tractable examples as checks, refine the grid and examine changes in the actual quantities to be reported. For the finite beta mixture above, the exact cumulative probability 3/16 at one-half provides such a benchmark. A stable mean alone does not establish accurate tails or quantiles. Missing a narrow mode can leave a numerically stable but scientifically wrong approximation; changing a discretization needs evidence tied to the relevant target.
A Laplace approximation uses local curvature of a log posterior near a mode. In unconstrained coordinates with a suitable positive-definite negative Hessian, the inverse curvature supplies a local Gaussian covariance approximation. Boundaries, skewness, weakly identified directions, multiple modes and tail behavior can make the local approximation inadequate. Coordinate transformations require their Jacobians and change density modes; convergence of an optimizer does not certify posterior approximation quality.
Posterior simulation also introduces Monte Carlo error. Correlated chain draws do not have the precision of the same number of iid draws, and chain diagnostics do not prove universal convergence or scientific model adequacy. Reuse the simulation lesson’s distinction between a target distribution and its computational estimator. Report numerical accuracy for the mean, tail probability or quantile actually used, separately from the posterior spread describing uncertainty in the target itself.
Show a large-sample connection within its model
The known-variance normal model gives a precise example of a diminishing prior contribution. With fixed finite m₀,τ₀²>0 and σ²>0, write wₙ=nτ₀²/(σ²+nτ₀²). Its posterior mean is m=wₙȳ+(1−wₙ)m₀ and variance v=wₙσ²/n for n≥1. As independent sample information nτ₀²/σ² grows, wₙ approaches one. The prior contribution to the center and the difference from σ²/n can be read directly from these exact expressions.
For any fixed true μ under this same iid normal sampling law, the posterior central interval has asymptotic fixed-μ coverage 1−α. To see why, standardize its center error by wₙσ/√n. The random part is standard normal; its deterministic shift is σ(m₀−μ)/(τ₀²√n), tending to zero. The interval halfwidth in that scale is z_(1−α/2)/√wₙ, tending to the usual normal cutoff. This is a derived connection in this specified model, not an assertion of finite-sample equality.
General posterior normal approximation and calibration results need regularity, identification, appropriate prior support and control of the actual model and dimension. A boundary parameter, a growing collection of poorly identified parameters, a mixture label ambiguity or a wrong likelihood can invalidate a simple normal argument. A large row count alone does not establish those conditions, and repeated correlated rows do not create the independent information used by this derivation.
Keep the finite-sample result separate from its limiting approximation. The earlier one-observation coverage example remains exactly as calculated. A continuous posterior’s point probability remains zero even when it concentrates in shrinking neighborhoods. For a particular scientific application, assess the approximation and observation assumptions at the available information level instead of replacing them with the phrase large sample.
Connect posterior uncertainty to the scientific design
In metascience, priors, model alternatives and predictive checks make analysis assumptions explicit and open to sensitivity analysis. A transparent posterior does not remove multiplicity, selective reporting or the consequences of choosing an analysis after inspecting results. Those issues concern the whole research process and remain part of the reproducibility and multiple-comparisons lessons.
In medical science, a model for an average population parameter, a prediction for a future individual and a probability of a model hypothesis can be different objects even when all are reported as probabilities. Measurement, selection, treatment allocation and transport to another population remain substantive assumptions. Bayesian conditioning represents uncertainty within the model; causal interpretation requires a design and identification argument connecting the parameter to the intervention question.
In psychology and related group-based sciences, hierarchical models can express partial sharing across participants, tasks or studies. The independent sampling unit, group structure and likelihood must match the design. A prior that pools groups around a common scale is useful only insofar as that scale and exchangeability judgment are scientifically defensible. Group-specific uncertainty and uncertainty about the shared population both matter for prediction.
These connections motivate a sequence: identify the scientific target, describe the observation process, justify a joint model, compute and check the posterior, then report sensitivity and the appropriate prediction or decision. Proper uncertainty statements do not replace a scientific measurement theory. They provide a disciplined way to expose the consequences of one.
Report the target, model and probability together
A clear report names the estimand and units, the sampling likelihood and design, the prior support and scale, and the data used for the update. It states whether the reported set is equal-tail, highest-density or another construction, its credibility, and the coordinate in which any shortest-length claim is made. Discrete endpoint masses and displayed rounding should be treated explicitly where they affect the conclusion.
For predictions, specify the future experiment and any sharing of latent parameters with the observed data. For model comparisons, state the complete model priors, prior odds and marginal-likelihood convention. For a hierarchy, distinguish fixed-hyperparameter calculations from integration over their uncertainty. These details determine the probability being reported and are more informative than an isolated interval or Bayes factor.
Separate scientific sensitivity from numerical accuracy. A second plausible prior or likelihood examines the consequences of modelling choices. A finer quadrature, an exact conjugate benchmark or a more precise Monte Carlo estimate examines calculation of the chosen model. A successful computational check cannot establish the model’s scientific adequacy, while a scientifically sensible model still needs accurate computation.
The essential starting path is posterior definition, credible-set meaning and prediction. The optional deeper path adds coordinate effects, evidence constants, improper kernels, coverage averaging, conditional pooling and approximation. The worked examples and explained exercises connect both paths through exact or explicitly approximate calculations. The next resampling lesson returns to repeated-data constructions, with its own assumptions and targets.
Compare the probability target, prior and observation model. The initial views are prepared snapshots. Change one case to evaluate that model; Reset restores the supplied snapshot.
Credible mass and density geometry
Original probability coordinate: equal-tail and HPD. Prepared under the stated probability model.
φ=p^(1), p~Beta(2,1); credibility=9/10.
Continuous posterior with Fp(p)=p². Coordinate support is[0,1]. The transformed density is(2/r)φ^(2/r−1) on(0,1); no endpoint atom is introduced by a divergent density. Equal-tail quantiles transform. Highest density and shortest length use the chosen coordinate.
| Quantity | Exact value or definition | Approximation | Units | Interpretation |
|---|---|---|---|---|
| Requested credibility | 9/10 | ≈0.9 | probability | Both defined continuous sets have this exact mass |
| Coordinate power | 1 | ≈1 | dimensionless | φ=p^r, an increasing one-to-one transformation on[0,1] |
| Equal-tail length | (1−(1/10)/2)^(1/2)−((1/10)/2)^(1/2) | ≈0.751073 | coordinate units | Length depends on the coordinate |
| Native highest-density interval length | 1−(1/10)^(1/2) | ≈0.683772 | coordinate units | Monotone density puts the shortest interval at a support boundary |
| Mapped original-p HPD length | 1−(1/10)^(1/2) | ≈0.683772 | coordinate units | Mapping preserves mass, not necessarily highest-density geometry |
Exact interval definitions and targets
| Interval | Lower definition | Upper definition | Numerical endpoints | Posterior mass | Target / units |
|---|---|---|---|---|---|
| Equal-tail interval | ((1/10)/2)^(1/2) | (1−(1/10)/2)^(1/2) | [≈0.223606797749979, ≈0.974679434480896] | 9/10 | Transformed coordinate φ; coordinate units |
| Native-coordinate HPD | (1/10)^(1/2) | 1 | [≈0.316227766016838, ≈1] | 9/10 | Density in the φ coordinate; coordinate units |
| Image of original-p HPD | (1/10)^(1/2) | 1 | [≈0.316227766016838, ≈1] | 9/10 | Mapped set; still credible; coordinate units |
Exact fractions, interval definitions, units and raw model inputs are preserved. Values marked ≈ are numerical approximations; short graph labels use six significant digits. Finite plotted grids join evaluated coordinates as guides, without claiming exact interpolation. Numerical rounding to zero or one does not itself establish impossibility or certainty. Posterior credibility, prediction and repeated-sampling coverage keep their stated conditioning and targets.
Predictive counts retain parameter uncertainty
Three future counts under Beta(8,4). Prepared under the stated probability model.
Posterior Beta(A=8,B=4); m=3.
The future trials are conditionally iid Bernoulli with the same uncertain p represented by this proper posterior. All counts0..m are included with exact rational masses, including m=0. The plug-in law is a comparison, not a posterior predictive replacement.
| Quantity | Exact value or definition | Approximation | Units | Interpretation |
|---|---|---|---|---|
| Posterior mean p | 2/3 | ≈0.666667 | probability parameter | Same mean used by the plug-in comparison |
| Posterior variance p | 2/117 | ≈0.017094 | squared probability-parameter units | Nonzero parameter uncertainty |
| Predictive count mean | 2 | ≈2 | passes | m A/(A+B) |
| Predictive count variance | 10/13 | ≈0.769231 | squared counts | Total variance retains uncertainty about the shared p |
| Plug-in binomial variance | 2/3 | ≈0.666667 | squared counts | Treats the posterior mean as a fixed known p |
| Extra predictive variance | 4/39 | ≈0.102564 | squared counts | m(m−1)Var(p|data) |
| Covariance of distinct future indicators | 2/117 | ≈0.017094 | squared indicator units | Conditional independence does not survive integration over the common p |
Every finite outcome or scenario
| Count | Exact predictive mass | Approximation | Exact plug-in mass | Approximation |
|---|---|---|---|---|
| 0 | 5/91 | ≈0.0549451 | 1/27 | ≈0.037037 |
| 1 | 20/91 | ≈0.21978 | 2/9 | ≈0.222222 |
| 2 | 36/91 | ≈0.395604 | 4/9 | ≈0.444444 |
| 3 | 30/91 | ≈0.32967 | 8/27 | ≈0.296296 |
Exact fractions, interval definitions, units and raw model inputs are preserved. Values marked ≈ are numerical approximations; short graph labels use six significant digits. Finite plotted grids join evaluated coordinates as guides, without claiming exact interpolation. Numerical rounding to zero or one does not itself establish impossibility or certainty. Posterior credibility, prediction and repeated-sampling coverage keep their stated conditioning and targets.
Parameter and future-observation targets
Mean, next reading and next average. Prepared under the stated probability model.
m0=10 mm; τ0²=4 mm²; σ²=9 mm². n=4; sum(y)=52 mm; r=4; level=19/20.
Proper normal prior with positive variance; known positive observation variance, each N second argument is variance. Observations are conditionally iid given μ. Future readings are conditionally independent of the observed sample with the same μ. Prediction is not a population-content tolerance guarantee; unknown variance or dependent observations need another model.
| Quantity | Exact value or definition | Approximation | Units | Interpretation |
|---|---|---|---|---|
| Posterior mean | 298/25 | ≈11.92 | mm | Precision-weighted center; empty data returns the prior |
| Posterior parameter variance | 36/25 | ≈1.44 | mm² | Uncertainty about the common mean |
| Next-reading variance | 261/25 | ≈10.44 | mm² | Adds the known observation variance |
| Future-average variance | 369/100 | ≈3.69 | mm² | Adds σ²/4, not σ² |
| Future-average variance limit | 36/25 | ≈1.44 | mm² | As future average size grows, shared mean uncertainty remains |
| Observed sample mean | 13 | ≈13 | mm | Data summary, not the unknown population mean |
Exact interval definitions and targets
| Interval | Lower definition | Upper definition | Numerical endpoints | Posterior mass | Target / units |
|---|---|---|---|---|---|
| Posterior parameter μ | (298/25)−z_((1+19/20)/2)√(36/25) | (298/25)+z_((1+19/20)/2)√(36/25) | [≈9.56804321855194, ≈14.2719567814481] | 19/20 | Common mean μ; mm |
| One future reading | (298/25)−z_((1+19/20)/2)√(261/25) | (298/25)+z_((1+19/20)/2)√(261/25) | [≈5.58716255632228, ≈18.2528374436777] | 19/20 | Future observation from the same μ; mm |
| Average of 4 future readings | (298/25)−z_((1+19/20)/2)√(369/100) | (298/25)+z_((1+19/20)/2)√(369/100) | [≈8.15503213182884, ≈15.6849678681712] | 19/20 | Future average from the same μ; mm |
Exact fractions, interval definitions, units and raw model inputs are preserved. Values marked ≈ are numerical approximations; short graph labels use six significant digits. Finite plotted grids join evaluated coordinates as guides, without claiming exact interpolation. Numerical rounding to zero or one does not itself establish impossibility or certainty. Posterior credibility, prediction and repeated-sampling coverage keep their stated conditioning and targets.
Posterior mass and fixed-truth coverage
Credibility95% is not pointwise95% coverage. Prepared under the stated probability model.
Prior μ~N(0,1), Y|μ~N(μ,1); true μ=3; observed Y=3; level=19/20.
This illustration fixes the proper joint normal model and the interval rule for every Y. Posterior credibility, fixed-parameter coverage and averaging over the prior condition on different objects. The prior-average identity uses measurability and a proper joint probability law, not a simulated quota.
| Quantity | Exact value or definition | Approximation | Units | Interpretation |
|---|---|---|---|---|
| Posterior credibility | 19/20 | ≈0.95 | probability | Conditional on the observed Y under the declared joint model |
| Fixed-μ coverage | Φ((3)+z_((1+19/20)/2)√2)−Φ((3)−z_((1+19/20)/2)√2) | ≈0.409748 | probability | Repeated sampling with μ fixed; Y and its interval vary |
| Proper-prior averaged coverage | 19/20 | ≈0.95 | probability | Integral of c(μ) against N(0,1), by the joint-model indicator identity |
| Observed posterior mean | 3/2 | ≈1.5 | standardized measurement units | Y/2 for this one-observation model |
| Observed posterior variance | 1/2 | ≈0.5 | squared standardized units | Parameter uncertainty after this Y |
Exact interval definitions and targets
| Interval | Lower definition | Upper definition | Numerical endpoints | Posterior mass | Target / units |
|---|---|---|---|---|---|
| Observed posterior interval | (3/2)−z_((1+19/20)/2)√(1/2) | (3/2)+z_((1+19/20)/2)√(1/2) | [≈0.114096175650324, ≈2.88590382434968] | 19/20 | Parameter μ conditional on observed Y; standardized units |
Exact fractions, interval definitions, units and raw model inputs are preserved. Values marked ≈ are numerical approximations; short graph labels use six significant digits. Finite plotted grids join evaluated coordinates as guides, without claiming exact interpolation. Numerical rounding to zero or one does not itself establish impossibility or certainty. Posterior credibility, prediction and repeated-sampling coverage keep their stated conditioning and targets.
The same likelihood under different priors
Identical likelihood, uniform or concentrated prior. Prepared under the stated probability model.
Identical Binomial(n=8,p) likelihood with k=6; Prior1: Beta(1,1); Prior2: Beta(20,20).
Fixed count of conditionally iid Bernoulli observations with one common p; both priors use the same observation representation. All beta priors are proper with positive shapes. Lower-half priors are explicitly normalized restrictions, not full-beta updates. A support exclusion cannot be reversed by multiplying by this likelihood. A positive-pass observation under a point-zero prior has no posterior. CDF curves join61 numerical evaluations; the plotted heights are not used as unweighted integration cells.
| Quantity | Exact value or definition | Approximation | Units | Interpretation |
|---|---|---|---|---|
| Prior1: posterior mean | 7/10 | ≈0.7 | probability parameter | Updated under the identical n,k common-p likelihood |
| Prior1: posterior variance | 21/1100 | ≈0.0190909 | squared probability-parameter units | Conditional spread; realized variance need not decrease |
| Prior1: P(p>1/2|data) | 233/256 | ≈0.910156 | probability | Exact finite-sum tail for integer posterior shapes |
| Prior1: prior variance | 1/12 | ≈0.0833333 | squared probability-parameter units | For comparison with the realized posterior variance |
| Prior2: posterior mean | 13/24 | ≈0.541667 | probability parameter | Updated under the identical n,k common-p likelihood |
| Prior2: posterior variance | 143/28224 | ≈0.00506661 | squared probability-parameter units | Conditional spread; realized variance need not decrease |
| Prior2: P(p>1/2|data) | 3166451366045/4398046511104 | ≈0.719968 | probability | Exact finite-sum tail for integer posterior shapes |
| Prior2: prior variance | 1/164 | ≈0.00609756 | squared probability-parameter units | For comparison with the realized posterior variance |
Every finite outcome or scenario
| Scenario | Prior | Posterior kernel / normalized law | Normalizer condition | Posterior support |
|---|---|---|---|---|
| 1 | Beta(1,1) | Beta(7,3) | 1 | [0,1] |
| 2 | Beta(20,20) | Beta(26,22) | 1 | [0,1] |
Exact fractions, interval definitions, units and raw model inputs are preserved. Values marked ≈ are numerical approximations; short graph labels use six significant digits. Finite plotted grids join evaluated coordinates as guides, without claiming exact interpolation. Numerical rounding to zero or one does not itself establish impossibility or certainty. Posterior credibility, prediction and repeated-sampling coverage keep their stated conditioning and targets.
Conditional pooling: existing and new groups
Fixed hyperparameters: small versus larger group. Prepared under the stated probability model.
Known m0=10 mm; τ²=4 mm²; σ²=9 mm². Group means=16,16 mm; counts=1,9; credibility=19/20.
Group parameters are iid N(m0,tau²) conditional on these known hyperparameters. Within and across groups, observations are conditionally independent N(θj,σ²) with the stated common known positive variance. These are conditional normal calculations, not a fit or integration over unknown hyperparameters. A new group brings between-group uncertainty. Exchangeability and appropriate pooling remain scientific assumptions, not causal comparability guarantees.
| Quantity | Exact value or definition | Approximation | Units | Interpretation |
|---|---|---|---|---|
| Group1: data weight | 4/13 | ≈0.307692 | dimensionless | Fixed-hyperparameter conditional weight, not a fitted hyperparameter |
| Group1: posterior mean | 154/13 | ≈11.8462 | mm | Between the fixed group-population mean and raw observed group mean |
| Group1: parameter variance | 36/13 | ≈2.76923 | mm² | Conditional on known m0,tau²,sigma² |
| Group1: existing-group reading variance | 153/13 | ≈11.7692 | mm² | σ²+vj for another observation in this same existing group |
| Group2: data weight | 4/5 | ≈0.8 | dimensionless | Fixed-hyperparameter conditional weight, not a fitted hyperparameter |
| Group2: posterior mean | 74/5 | ≈14.8 | mm | Between the fixed group-population mean and raw observed group mean |
| Group2: parameter variance | 4/5 | ≈0.8 | mm² | Conditional on known m0,tau²,sigma² |
| Group2: existing-group reading variance | 49/5 | ≈9.8 | mm² | σ²+vj for another observation in this same existing group |
| New-group parameter mean | 10 | ≈10 | mm | Known fixed group-population mean |
| New-group parameter variance | 4 | ≈4 | mm² | A new group has not supplied its own observations |
| New-group reading variance | 13 | ≈13 | mm² | Between-group plus observation variance |
Exact interval definitions and targets
| Interval | Lower definition | Upper definition | Numerical endpoints | Posterior mass | Target / units |
|---|---|---|---|---|---|
| Group1 parameter θ1; n=1 | (154/13)−z_((1+19/20)/2)√(36/13) | (154/13)+z_((1+19/20)/2)√(36/13) | [≈8.5845766256976, ≈15.1077310666101] | 19/20 | Existing-group parameter θ1; mm |
| New reading in existing group1 | (154/13)−z_((1+19/20)/2)√(153/13) | (154/13)+z_((1+19/20)/2)√(153/13) | [≈5.12224015312907, ≈18.5700675391786] | 19/20 | Future reading sharing θ1; mm |
| Group2 parameter θ2; n=9 | (74/5)−z_((1+19/20)/2)√(4/5) | (74/5)+z_((1+19/20)/2)√(4/5) | [≈13.0469549188468, ≈16.5530450811532] | 19/20 | Existing-group parameter θ2; mm |
| New reading in existing group2 | (74/5)−z_((1+19/20)/2)√(49/5) | (74/5)+z_((1+19/20)/2)√(49/5) | [≈8.66434221596394, ≈20.9356577840361] | 19/20 | Future reading sharing θ2; mm |
| Reading in a genuinely new group | (10)−z_((1+19/20)/2)√(13) | (10)+z_((1+19/20)/2)√(13) | [≈2.93324935567814, ≈17.0667506443219] | 19/20 | New group parameter drawn from the fixed group distribution; mm |
Exact fractions, interval definitions, units and raw model inputs are preserved. Values marked ≈ are numerical approximations; short graph labels use six significant digits. Finite plotted grids join evaluated coordinates as guides, without claiming exact interpolation. Numerical rounding to zero or one does not itself establish impossibility or certainty. Posterior credibility, prediction and repeated-sampling coverage keep their stated conditioning and targets.
Worked examples
A posterior is more than its best-looking point
A process pass fraction has Beta(2,2) prior. Six of eight fixed, conditionally iid checks pass. Find its posterior distribution, mean, interior mode, variance and 95% equal-tail credible interval.
- The prior kernel is p(1−p), and the likelihood kernel is p⁶(1−p)². Their product is p⁷(1−p)³. Normalizing over [0,1] uses B(8,4), so the posterior is Beta(8,4).
- The posterior mean is 8/12=2/3. Both shapes exceed one, so the interior mode is (8−1)/(8+4−2)=7/10. These summaries need not coincide because this posterior is not symmetric.
- The variance is 8·4/(12²·13)=2/117. It measures uncertainty about the population fraction under this model, rather than variability of an eight-trial observed fraction in a new experiment.
- Solve F(q₀.₀₂₅)=0.025 and F(q₀.₉₇₅)=0.975 using the Beta(8,4) cumulative distribution. The endpoints are approximately 0.3902574404 and 0.8907365562. Their exact quantile definitions carry the stated mass; rounded displayed endpoints only approximate it.
Beta(8,4); mean 2/3, mode 7/10 and variance 2/117. The 95% equal-tail interval is approximately [0.39025744,0.89073656], conditional on the prior and common-p sampling model.
Equal credibility does not require equal endpoints
For a Beta(2,1) posterior, construct the 90% equal-tail interval and shortest contiguous 90% credible interval. Compare their lengths.
- The cumulative distribution on [0,1] is F(p)=p². Equal tails of 0.05 give [√0.05,√0.95]=[√(1/20),√(19/20)]. Its mass is 19/20−1/20=9/10.
- The density 2p is increasing. For a fixed interval length, shifting the interval right increases its probability, so a shortest contiguous interval reaches 1. Set 1−l²=9/10, giving l=√(1/10).
- The equal-tail interval is approximately [0.22360680,0.97467943], length 0.75107264. The highest-density interval is approximately [0.31622777,1], length 0.68377223.
- The same 90% posterior mass supports both intervals. The shortest-length statement refers to the p coordinate and the given unimodal increasing density; it does not define a universally invariant best uncertainty summary.
Both sets have exact mass 9/10. The highest-density interval is shorter in p coordinates and has unequal tail allocation.
Three future outcomes share uncertainty about p
After the Beta(8,4) posterior in the first example, predict passes K in three future checks of the same process. Compare the full predictive variance with a binomial plug-in calculation.
- Integrate C(3,j)pʲ(1−p)^(3−j) against Beta(8,4). The four resulting probabilities are 5/91,20/91,36/91 and 30/91. Their numerators sum to 91.
- The predictive mean is 3·8/12=2. With A=8,B=4,s=12,m=3, the variance is 3·8·4·15/(12²·13)=10/13.
- A plug-in Binomial(3,2/3) has mean 2 and variance 3(2/3)(1/3)=2/3. The variance difference is 10/13−2/3=4/39.
- For distinct future checks, covariance equals the posterior variance of p, 2/117. Adding the three Bernoulli variances and the six off-diagonal covariance terms gives the same predictive count variance. These are future trials sharing a latent p, not observed checks reused as new data.
P(K=0,1,2,3|y)=(5,20,36,30)/91, with mean 2 and variance 10/13. A plug-in binomial omits shared parameter uncertainty.
Retain rate units and the complete likelihood
A hypothetical fault rate λ per hour has Gamma(shape 2,rate 1 hour) prior. Counts (1,0,3) occur over (1/2,1,3/2) hours. Find the posterior, probability of this count vector, and predictive moments and zero probability for two future hours.
- The total count is 4 and total exposure is 3 hours. Updating the gamma kernel gives shape 6 and rate 4 hours, so the posterior mean is 6/4=3/2 per hour and variance 6/4²=3/8 per squared hour.
- The exposure/factorial constant is (1/2)¹·1⁰·(3/2)³/(1!0!3!)=9/32. Integrating the remaining kernel gives Γ(6)/4⁶=120/4096. Their product is 135/16384. The prior factors are 1²/Γ(2)=1 in these stated units.
- For two future hours, mixing Poisson(2λ) with Gamma(6,4) gives P(K=j|y)=Γ(6+j)/[Γ(6)j!]·(2/3)⁶(1/3)ʲ, j=0,1,… . In particular P(K=0|y)=(2/3)⁶=64/729.
- Total expectation gives 2(6/4)=3 events. Total variance is 2(6/4)+2²(6/4²)=3+3/2=9/2. The second term is uncertainty about the common rate; the predictive count variance is therefore larger than a Poisson variance fixed at the same mean.
Posterior Gamma(6,4 hours); count-vector evidence 135/16384. Over two future hours, P(K=0)=64/729, E[K]=3 and Var(K)=9/2.
Two credible intervals for a positive rate
Begin with Gamma(1,1 hour) prior and observe zero faults over two hours under the conditional Poisson model. Find a 90% highest-density interval and a 90% equal-tail interval for the rate.
- The posterior is Gamma(1,3 hours), with cumulative distribution F(λ)=1−e^(−3λ) in per-hour coordinates. Its density decreases for λ>0.
- A highest-density 90% set begins at the lower boundary. Solve e^(−3u)=0.1, giving u=ln(10)/3≈0.76752836 per hour.
- The central interval solves F(l)=0.05 and F(u)=0.95. It is [−ln(0.95)/3,−ln(0.05)/3]≈[0.01709776,0.99857742] per hour.
- Each interval has mass 0.9 under this continuous posterior. Including zero in the first displayed interval adds no atom, and neither interval is an interval for a future number of faults.
Highest-density set [0,ln(10)/3] and equal-tail set [−ln(0.95)/3,−ln(0.05)/3], in faults per hour.
A mean interval and a prediction interval
A sensor mean in mm has N(10,4 mm²) prior. Four independent readings have average 13 mm and known observation variance 9 mm². Find posterior uncertainty about μ and a central 95% interval for one future reading.
- The posterior precision is 1/4+4/9=25/36 per squared mm, so v=36/25 mm². The weighted numerator is 10/4+4·13/9=149/18 per mm, giving m=(36/25)(149/18)=298/25=11.92 mm.
- The posterior mean SD is √v=6/5 mm. Its central interval is 298/25±z₀.₉₇₅·6/5, approximately [9.56804322,14.27195678] mm.
- One new independent reading has predictive variance 9+36/25=261/25 mm² and the same predictive mean. Its central interval is 298/25±z₀.₉₇₅√261/5, approximately [5.58716256,18.25283744] mm.
- The added 9 mm² describes variability of a future reading about μ. The observation variance is genuinely known in this example; an estimated SD would require a different joint calculation.
μ|y∼N(298/25,36/25) in the stated units. Its 95% credible interval is narrower than the future-reading interval because prediction adds observation variability.
Compute the two conditional probabilities
For μ∼N(0,1) and Y|μ∼N(μ,1), repeatedly use the 95% posterior interval Y/2±z₀.₉₇₅/√2. Calculate its fixed-μ coverage at 0 and 3, and its prior-averaged coverage.
- The posterior precision is 2 and mean Y/2. The displayed interval therefore has exact posterior mass 0.95 for every finite observed Y.
- Containment of a fixed μ is equivalent to 2μ−z₀.₉₇₅√2≤Y≤2μ+z₀.₉₇₅√2. Under this fixed μ, write Y=μ+Z with Z∼N(0,1).
- Consequently c(μ)=Φ(μ+z₀.₉₇₅√2)−Φ(μ−z₀.₉₇₅√2). At μ=0 it is approximately 0.9944254033; at μ=3 it is approximately 0.4097483498.
- Integrating c(μ) against its proper N(0,1) prior gives E[Π(μ∈C(Y)|Y)]=0.95. This follows from conditional expectation and does not require either of the two fixed-μ values to equal 0.95.
Exact 95% posterior credibility coexists with fixed-μ coverages about 99.44% and 40.97% in these two cases; prior-averaged coverage is exactly 95%.
Measure sensitivity without changing the observations
For six passes in eight fixed common-p checks, compare Beta(1,1) and Beta(20,20) priors. Report posterior means and posterior probabilities p>1/2.
- The likelihood kernel is p⁶(1−p)² in both analyses. The first posterior is Beta(7,3), with mean 7/10; the second is Beta(26,22), with mean 26/48=13/24.
- For integer beta shapes, P(p>1/2) can be checked using the corresponding finite binomial sum: for Beta(A,B), it is 2^(−A−B+1)Σ_(j=0)^(A−1)C(A+B−1,j).
- The Beta(7,3) probability is 233/256. For Beta(26,22) it is 3166451366045/4398046511104. These are exact rational probabilities, not rounded thresholds or p-values.
- The Beta(20,20) prior concentrates more mass near one-half. Its shape parameters are model information, not forty additional observed physical checks. Whether that concentration is plausible requires scientific justification and prior predictive examination.
Posterior means 7/10 and 13/24; probabilities above one-half 233/256 and 3166451366045/4398046511104. The difference is prior sensitivity under an identical likelihood.
Normalization must be earned
Use the improper kernel 1/[p(1−p)] for a common Bernoulli probability. Compare two passes out of five with zero passes out of five. Explain why posterior properness would still not fix a model evidence constant.
- The updated kernel is p^(k−1)(1−p)^(n−k−1). A beta integral on (0,1) is finite only if both shapes are positive.
- For k=2,n=5 the shapes are 2 and 3, producing proper Beta(2,3). For k=0,n=5 the kernel contains p^(−1) near zero and has a divergent integral.
- An arbitrary positive multiplicative constant in the original improper kernel cancels from the normalized posterior when that posterior exists. It remains in the unnormalized marginal likelihood.
- The flat normal illustration makes this explicit: c times a flat μ kernel leads to the same N(y,1) posterior after one N(μ,1) observation, while the formal evidence is c. Choosing a normalized conditional answer does not determine that arbitrary constant.
The 2/5 case yields Beta(2,3); the 0/5 case has no proper posterior under this kernel. Improper-prior constants require a separate model-comparison justification.
The alternative prior changes its predictive evidence
One standardized reading is Y=2 with known observation variance 1. Compare μ=0 against μ∼N(0,τ²), for τ=1,10,100. With prior odds M₁:M₀=1:3, find the corresponding posterior model probabilities.
- The null marginal density is N(0,1) at 2; the alternative marginal density is N(0,1+τ²) at 2. Their ratio is BF₁₀=(1+τ²)^(−1/2)exp[2τ²/(1+τ²)].
- The ratios are approximately 1.9221155141,0.7208225860 and 0.0738720923. Both models use the same standardized observation and its full density factors.
- Prior odds 1:3 give posterior odds BF₁₀/3. Conversion to probability gives BF₁₀/(3+BF₁₀), approximately 0.3905059742,0.1937266745 and 0.0240322597.
- Increasing τ spreads the alternative over a wider range of possible observations. That changes its marginal likelihood even though the observed reading is unchanged. This is model-prior sensitivity, and the ratios are not posterior probabilities until prior odds have been supplied.
At the stated prior odds, P(M₁|y) is approximately 0.390506,0.193727 and 0.0240323. Proper, increasingly diffuse alternative priors need not give the same evidence.
The same group mean can lead to different shrinkage
Two hypothetical groups have observed mean 16 mm, with sample sizes 1 and 9. In the normal hierarchy take fixed m₀=10 mm,τ²=4 mm² and σ²=9 mm². Find conditional group posteriors and variances for one future reading in an existing group or a new group.
- For n=1, w=4/(9+4)=4/13. The posterior mean is 10+(4/13)(16−10)=154/13 mm and variance (1/4+1/9)^(−1)=36/13 mm².
- For n=9, w=36/(9+36)=4/5. The posterior mean is 10+(4/5)·6=74/5 mm and variance (1/4+9/9)^(−1)=4/5 mm². The larger group has more independent information and is pulled less toward 10.
- One future reading in each existing group adds observation variance 9 mm², giving 153/13 and 49/5 mm². Its predictive mean is the corresponding group posterior mean.
- A genuinely new group, before its own observations and with the hyperparameters still fixed, has a new group parameter variance 4 mm². One reading therefore has variance 4+9=13 mm² and mean 10 mm. Learning unknown hyperparameters would require their posterior integration, which is not performed by this conditional illustration.
Conditional means 154/13 and 74/5 mm, with variances 36/13 and 4/5 mm². Existing-group and new-group prediction use different uncertainty components.
Update component weights as well as component parameters
A pass probability has prior (1/2)Beta(1,4)+(1/2)Beta(4,1). One pass is observed. Find the evidence, posterior mixture, posterior mean and P(p≤1/2).
- The probability of a pass is the prior mean within each component: 1/5 and 4/5. Combining their equal prior weights gives evidence (1/2)(1/5)+(1/2)(4/5)=1/2.
- The posterior component weights are [(1/2)(1/5)]/(1/2)=1/5 and 4/5. One pass updates the component shapes to Beta(2,4) and Beta(5,1), so the posterior is (1/5)Beta(2,4)+(4/5)Beta(5,1).
- The posterior mean is (1/5)(2/6)+(4/5)(5/6)=11/15. The component cumulative probabilities at one-half are 13/16 and 1/32.
- Weighting those cumulative probabilities gives (1/5)(13/16)+(4/5)(1/32)=3/16. The probability at the single point p=1/2 is zero because both components are continuous. This exact calculation can benchmark a numerical integration of the same posterior.
Evidence 1/2; posterior (1/5)Beta(2,4)+(4/5)Beta(5,1), mean 11/15 and P(p≤1/2)=3/16.
Try it yourself
A common-p process has Beta(3,5) prior. Four passes occur in ten fixed conditionally independent checks. Find the posterior mean and variance.
Show the answer and reasoning
Posterior Beta(7,11), mean 7/18 and variance 77/6156.
Add four passes and six failures to the two positive prior shapes. With s=18, the variance is 7·11/(18²·19)=77/6156. The distribution concerns p under this model, rather than the random count in another set of ten checks.
With a uniform Beta(1,1) prior, no passes occur in four checks. Find a 95% posterior upper bound for p and P(p<1/5).
Show the answer and reasoning
The upper bound is 1−0.05^(1/5)≈0.4507197283, and P(p<1/5)=2101/3125.
The posterior is Beta(1,5), whose cumulative distribution is 1−(1−p)⁵. Set this equal to 0.95 for the upper endpoint. At p=1/5 it is 1−(4/5)⁵=2101/3125. No observed passes do not establish that the unknown probability is exactly zero.
For posterior Beta(2,1), construct 80% equal-tail and highest-density intervals in the p coordinate.
Show the answer and reasoning
Equal-tail [√0.1,√0.9]; highest-density [√0.2,1].
Use F(p)=p². Equal tails remove 0.1 on each side. Since density increases, a shortest contiguous interval reaches the upper boundary and must satisfy 1−l²=0.8. Both intervals have mass 0.8; their tail allocations differ.
A posterior has masses 1/2,3/10,1/5 at θ=0,1,2. Can a nonrandomized subset have exact 95% posterior mass? Find a set with at least that mass and one with exactly 80%.
Show the answer and reasoning
Exact 95% is unattainable. All three points give mass 1; {0,1} gives mass 4/5.
The possible subset masses are 0,1/5,3/10,1/2,7/10,4/5 and 1, with 1/2 occurring in two ways. None is 19/20. Every proper subset omits at least 1/5 and therefore falls below 0.95. Atom handling is essential to the credible-set definition.
Given posterior Beta(3,2), find the probability of two future passes, its plug-in counterpart using E[p|y], and the covariance of the two future indicators.
Show the answer and reasoning
The probabilities are 2/5 and 9/25; covariance is 1/25.
Conditional independence gives E[Y₁Y₂|y]=E[p²|y]=3·4/(5·6)=2/5. The plug-in product is (3/5)²=9/25. Their difference is Var(p|y)=3·2/(5²·6)=1/25, explaining the marginal predictive dependence.
A rate per hour has Gamma(shape 3,rate 2 hours) prior. Five faults are observed during four fixed hours. Find posterior mean and variance.
Show the answer and reasoning
Gamma(8,6 hours), with mean 4/3 per hour and variance 2/9 per squared hour.
The count adds five to the shape and exposure adds four hours to the rate parameter. The moments are 8/6 and 8/6². The rate parameter has time units; confusing it with a scale would invert the update’s interpretation.
Continue the preceding Gamma(8,6 hours) posterior. For three future hours find P(K=0),E[K] and Var(K).
Show the answer and reasoning
P(K=0)=256/6561, E[K]=4 and Var(K)=6.
The predictive zero probability is [6/(6+3)]⁸=(2/3)⁸. Total expectation gives 3·8/6=4; total variance gives 4+3²·8/6²=6. The additional two count-variance units arise from posterior uncertainty about the rate.
A rate measured per minute has Gamma(8,rate 6 minutes) posterior. Express the same rate distribution per hour and find its mean.
Show the answer and reasoning
The per-hour numerical rate has Gamma(8,rate 1/10 hour) distribution and mean 80 per hour.
Let λhour=60λminute. Under this positive scaling, the gamma shape stays 8 and the numerical rate parameter divides by 60; 6 minutes equals 1/10 hour. The density transformation includes a factor 1/60. The mean changes from 8/6 per minute to 60·8/6=80 per hour.
Let μ∼N(5,4) and take three independent N(μ,12) observations with mean 9, in consistent measurement units. Find the posterior and central 90% interval.
Show the answer and reasoning
Posterior N(7,2); central 90% interval 7±z₀.₉₅√2≈[4.67382569,9.32617431].
The precision is 1/4+3/12=1/2, so variance is 2. The precision-weighted numerator is 5/4+27/12=7/2, giving posterior mean 7. The second arguments are variances, and observation variance 12 is known here.
Under the preceding normal model, compare posterior variance of μ with predictive variance of one new independent reading. What is the ratio of central interval halfwidths at the same credibility?
Show the answer and reasoning
The variances are 2 and 14; predictive-to-mean halfwidth ratio is √7.
Prediction adds the known observation variance 12 to posterior variance 2. Both normal intervals use the same quantile, so their halfwidth ratio is √14/√2=√7. A new average of r readings would instead add 12/r.
Use the interval rule in the one-observation normal coverage example at fixed true μ=1. Find its repeated-sampling coverage.
Show the answer and reasoning
Φ(1+z₀.₉₇₅√2)−Φ(1−z₀.₉₇₅√2)≈0.9617057192.
Its containment condition is 2−z₀.₉₇₅√2≤Y≤2+z₀.₉₇₅√2. Under fixed μ=1, standardize Y−1 to obtain these two normal limits. The posterior mass conditional on Y remains 0.95, which is a different calculation.
A proper joint model has jointly measurable sets C(y) with posterior mass 0.9 for almost every y under the joint data law. Prove their prior-averaged coverage, and state the version for mass at least 0.9.
Show the answer and reasoning
Prior-averaged coverage is exactly 0.9, or at least 0.9 in the inequality version.
Integrate the nonnegative indicator 1{θ∈C(y)} under Π(dθ)f(y|θ)dy. Integrating first over y gives ∫Pθ{θ∈C(Y)}Π(dθ). Conditioning first on y gives E[Π(C(Y)|Y)]. Properness, measurability and the almost-everywhere condition justify the identity. It does not assert coverage 0.9 at every fixed θ.
Under the Haldane kernel 1/[p(1−p)], compare three passes out of three with two passes out of three. Which posterior kernels normalize?
Show the answer and reasoning
The 3/3 kernel has formal shapes (3,0) and is improper. The 2/3 case is proper Beta(2,1).
The updated shapes are k,n−k. Both must be positive for the beta integral to converge. At three passes, the (1−p)^(−1) factor diverges at p=1. A positive prior kernel without a finite integral cannot be treated as an ordinary proper prior just because a named formula can be written.
One standardized reading is y=1 with known variance 1. Compare μ=0 with μ∼N(0,9), and take prior odds M₁:M₀=2:1. Find BF₁₀ and posterior P(M₁|y) for this two-model choice.
Show the answer and reasoning
BF₁₀=e^(9/20)/√10≈0.4959438588; P(M₁|y)≈0.4979636698.
Under the alternative, the marginal observation variance is 10. Dividing its density at 1 by the unit-variance null density gives the stated ratio. Posterior odds are twice the ratio, so probability is 2BF₁₀/(1+2BF₁₀). A ratio below one and prior odds above one can combine to a probability near one-half.
For p∼Beta(2,1), define φ=p². Find its law and describe the images of the 90% equal-tail interval and the highest-density construction.
Show the answer and reasoning
φ is uniform on [0,1]. The equal-tail interval maps to [0.05,0.95]; highest-density 90% sets in φ are nonunique because the density is constant.
For 0≤t≤1, P(φ≤t)=P(p≤√t)=t. The increasing transformation preserves quantiles and set probabilities. The p-coordinate highest-density interval maps to [0.1,1], one possible 90% set in a uniform law. This tie example shows why density optimality needs a coordinate; the cubic transformation in the text gives an explicit change of the optimal region.
With a uniform prior for p and two observed passes in two fixed checks, calculate P(Krep≥2|y) for a new two-check replication. Is this automatically a uniformly calibrated fixed-null p-value?
Show the answer and reasoning
The probability is 3/5. It is a posterior predictive tail probability, with no automatic fixed-null uniform calibration.
The posterior is Beta(3,1), and Krep≥2 means two passes, with posterior predictive probability E[p²|y]=3·4/(4·5)=3/5. This conditions on a posterior fitted to the observations. Its interpretation and reference experiment differ from a test statistic calibrated under one fixed null sampling law.
In the normal hierarchy take fixed m₀=0,τ²=1,σ²=4 and group mean 8. Compare conditional posteriors at n=1 and n=4.
Show the answer and reasoning
At n=1, mean 8/5 and variance 4/5. At n=4, mean 4 and variance 1/2.
The precision is 1+n/4 and the mean is [n·8/4]/[1+n/4]. The smaller group is pulled more toward the fixed population mean. These are conditional results: uncertainty about hyperparameters would require another posterior integration and can add variance.
For the final worked mixture posterior, calculate probability at most one-half from the component cumulative distributions. Distinguish it from density at one-half and describe a necessary grid-integration check.
Show the answer and reasoning
The probability is 3/16, while point probability at one-half is zero. A grid approximation must use suitable cell weights and be checked against this exact benchmark and refinement.
The weighted cumulative probability is (1/5)(13/16)+(4/5)(1/32)=3/16. A density value is probability per parameter unit, not probability at a point. Normalizing sampled density heights alone does not certify an integral; cell widths, support, tails and relevant approximation changes must be assessed.
What to carry forward
- Posterior probability is conditional on a declared prior, sampling law and observations. Check finite positive normalization, parameter units and the observation design.
- Credible sets describe posterior mass. Equal-tail, highest-density, discrete and transformed sets need their actual definitions; shortest length and density rankings depend on coordinates.
- Predictive distributions integrate parameter uncertainty. Future observations sharing an uncertain parameter can be marginally dependent even when conditionally independent.
- Credibility, fixed-parameter coverage and prior-averaged calibration are different targets. Proper joint models give an averaging identity, not universal pointwise coverage.
- Prior support, plausible scale choices and the full likelihood affect conclusions. Improper posterior kernels and omitted evidence constants require separate justification.
- Model probabilities require complete models and prior odds. A Bayes factor or predictive tail is not automatically a posterior model probability or a calibrated fixed-null p-value.
- Hierarchical pooling, numerical approximation and scientific model checking introduce distinct assumptions. Preserve their uncertainty and report the quantity that the calculation actually supports.
References
Sources for the concepts and teaching approaches in this article.
- 18.05, Spring2022MIT OpenCourseWare; Jeremy Orloff and Jonathan BloomUniversity course reading · PDFProbability intervalsChoosing priors
Alicia A. Johnson, Miles Q. Ott and Mine Dogucu4 sources
- The Beta-Binomial Bayesian ModelAlicia A. Johnson, Miles Q. Ott and Mine DogucuAuthor hosted textbook chapter
- Conjugate FamiliesAlicia A. Johnson, Miles Q. Ott and Mine DogucuAuthor hosted textbook chapter
- Posterior Inference & PredictionAlicia A. Johnson, Miles Q. Ott and Mine DogucuAuthor hosted textbook chapter
- Hierarchical Models are ExcitingAlicia A. Johnson, Miles Q. Ott and Mine DogucuAuthor hosted textbook chapter
- Bayes FactorsRobert E. Kass and Adrian E. Raftery; University of Washington-hosted articlePrimary methodological article · PDF