For a normalized uniform prior on , Bayesian model evidence is . It averages the likelihood over the prior range. Extending a well-placed interval into low-likelihood regions reduces that average, but moving or widening a poorly placed interval can improve it. A model prior is separate: posterior model odds equal the evidence ratio multiplied by prior model odds.
Likelihood function Created 2026-09-24 Updated 2026-10-14
For a fixed observed sample , a likelihood function is
where is the probability mass function or probability density function of the observations under the statistical parameter . All densities must be defined relative to the same parameter-independent dominating measure. The sample is fixed; the parameter is the function's argument. With independent and identically distributed random variables, the joint mass or density factors as . This definition and the distinction between sampling probability and parameter uncertainty are explained in MIT 18.05, Reading 10b, sections 3 and 3.2.
For an observed ordered sequence of ten independent Bernoulli trials containing eight successes and two failures, each success contributes and each failure contributes , giving
If the observation is instead only the total count , its binomial distribution probability mass function sums over the possible ordered sequences:
The raw heights differ: at they are approximately and . Their maximum-likelihood estimates are identical. More generally, multiplication by any finite positive constant independent of leaves the maximizing parameter values and all likelihood ratios unchanged. Multiplication by a parameter-dependent factor can change the MLE; dropping such a factor is not justified. Relative likelihood height sets the peak to one, without making the area under the curve one.
Normalization of is over possible data values for each fixed parameter. It imposes no requirement that . For example, the ordered Bernoulli trials likelihood above has
Its integral is not one, and its values are not posterior probabilities for . When the Bayesian posterior is defined, Bayes' theorem multiplies the likelihood by a prior density and normalizes that product. Choosing to normalize a likelihood function alone is an additional choice, such as using a uniform prior in those parameter coordinates, rather than part of the definition of likelihood.
For observations with a probability density function, the probability of an exact sample point is zero. If a scalar density is continuous at the observed value , then
Thus the density compares probabilities of small, equal observation intervals at different parameter values; it is not itself the probability of that exact real number. The equal-width factor is independent of the parameter. This gives visual intuition for density likelihoods, as in MIT 18.05, Reading 10b, section 4. The normal distribution example in maximum-likelihood estimator makes the comparison explicit. If only rounded intervals are recorded, their integrated probabilities give the exact observation likelihood; using midpoint densities is an approximation.
A prior distribution assigns uncertainty to a parameter before observing data. Multiplying its density by the likelihood and normalizing gives the posterior distribution. A Bayes estimator minimizes the posterior expected loss function for each observed sample, and therefore minimizes integrated Bayes risk when the expectations exist.
For quadratic loss , the conditional risk is , so its minimizer is the posterior mean. For absolute loss , the one-sided derivatives or subgradients show that a minimizer is any posterior median, characterized by and .
For the stated uniform distribution sampling model, let , . The likelihood is on and zero elsewhere. Intersecting this interval with the uniform prior gives
When , the bounded uniform-location posterior is
The posterior is symmetric, so its mean and unique median coincide. If , the data have zero marginal likelihood under the stipulated prior/sampling model and this posterior density cannot be normalized. An empty or singleton intersection is not an ordinary uniform posterior of positive width.
A uniform prior on makes the posterior density proportional to the Poisson change-point posterior likelihood above. The zeros trick introduces an observed zero with Poisson distribution mean , making its likelihood function equal to . Choose ; since , this mean is strictly positive. Rough BUGS code, with zero=0 supplied as data, is
model {
  theta ~ dunif(0,T)
  for (i in 1:n) {
    before[i] <- step(theta-time[i])
  }
  j <- sum(before[])
  logL <- theta-2*T+(n-j)*log(2)
  zero ~ dpois(K-logL)
}
For , omit the array and set j <- 0. Monitor the sampled theta to obtain its posterior mean, credible interval and interval probabilities.
There is also an exact sampling method. On the posterior density is proportional to , so choose the interval with weights
Then draw from a uniform distribution on and set . These weighted interval draws sample the posterior directly, without asking a local Markov chain Monte Carlo update to cross its discontinuities.
Use a proper normal distribution prior centered at zero on the log odds ratio. For example,
puts approximately 95 percent of its mass between and , giving odds ratios roughly between and , close to and . Centering at zero treats reciprocal odds ratios symmetrically. If the desired central 95 percent interval is exactly , use standard deviation . A soft prior is appropriate for implausibility, whereas a bounded uniform prior would declare effects outside the limits impossible.
The overall mean and the between-study heterogeneity encode different information. A proper broad normal distribution prior such as is one possible weak prior for the mean log odds ratio; information about the spread of trials alone does not determine its center.
A concrete prior calibration for normal random-effect range can make the factor-of-50 statement simultaneous across all six trials. Conditional on , each pair difference has normal distribution . Set , , and
For every , each pair exceeds in absolute value with probability at most . The union bound therefore gives , and integrating over the uniform prior preserves that bound. This is one explicit interpretation of “very unlikely”; a different elicited probability would change the bound. A smoother proper scale prior could be calibrated similarly.
The proposed improper prior is unsuitable. The observed-data likelihood function approaches the positive common-effect likelihood as . After restricting and the intercepts to a compact interior region, it is bounded below there by a positive constant. Hence
This is an improper posterior from a log-uniform random-effect scale prior. Proper conditional sampling distributions do not repair the improper joint posterior, and an arbitrary tiny cutoff would make inference depend on that cutoff.
Represent the independent locally flat intercept prior distributions by broad finite uniform priors, for example on ; this is proper and approximately constant over plausible mortality logits. With calibrated above, rough BUGS code is
model {
  mu ~ dnorm(0,0.25)
  tau ~ dunif(0,A)
  invtau2 <- pow(tau,-2)
  for (j in 1:J) {
    alpha[j] ~ dunif(-10,10)
    beta[j] ~ dnorm(mu,invtau2)
    logit(thetaC[j]) <- alpha[j]-beta[j]/2
    logit(thetaT[j]) <- alpha[j]+beta[j]/2
    rC[j] ~ dbin(thetaC[j],nC[j])
    rT[j] ~ dbin(thetaT[j],nT[j])
    oddsRatio[j] <- exp(beta[j])
  }
}
Use and supply treated death counts with totals , and control death counts with totals . In BUGS, the second dnorm argument is a precision parameter, so 0.25 corresponds to variance four. Initialize the positive scale away from zero. Monitor and study odds ratios, checking Markov chain Monte Carlo convergence diagnostics and sensitivity to the finite intercept bounds and scale prior distribution. The fitted hierarchy combines binomial sampling uncertainty with between-study heterogeneity.
The uniform prior has , so the posterior is . Its mean and mode are
Thus the uniform-prior posterior mode is the maximum-likelihood estimator, including . The mean shrinks toward and equals the maximum-likelihood estimator only when .
Put and . Dropping factors independent of , the multinomial likelihood and uniform prior give the posterior density
Multiplying this by the stipulated binomial distribution for the latent variable cancels the factor :
Consequently the two full conditional distributions are
Start with , sample from its binomial distribution, then sample a new from its Beta distribution, and repeat. The binomial distribution can be sampled by adding independent Bernoulli random variables. For the Beta distribution, take independent and and return ; integer-shape gamma distributions are sums of independent unit-rate exponential distributions. Both shapes are positive even when some observed counts vanish.
Each Gibbs sampler update preserves the augmented posterior distribution, so its marginal distribution is the required posterior distribution. The positive full conditional distributions on the interior allow exploration of the entire support. These iterates are generally dependent; they are not the independent exact draws constructed in the later parts.
For observation , the likelihood is proportional to . For , its logarithmic derivative is , vanishing uniquely at ; the logarithm is strictly concave. At or , monotonicity gives the boundary maximum. Thus the maximum-likelihood estimator is
A uniform prior multiplies this likelihood by a constant. The beta-integral normalization therefore gives the posterior distribution
In particular the posterior mean is not automatically the optimal estimator for the weighted loss in the next part.
For every estimator, its worst-case risk dominates its average risk under the uniform prior. Since the preceding Bayes estimator minimizes that average,
The estimator has risk exactly throughout the interior, so it attains this lower bound. Under either endpoint convention discussed above its supremum over is also . Thus
This constant-risk Bayes argument works also for , when the only observed counts are endpoints and the posterior integrability argument still selects their corresponding decisions.
Condition on . For , the posterior expected loss is a strictly convex quadratic in the decision . Its minimizer is
The beta density gives and , so . If , every has infinite posterior expected loss because of the nonintegrable term near zero, whereas has finite loss expectation. The analogous argument at forces . Hence the Bayes estimator is
Indeed is unbiased and has variance , which cancels the loss denominator. Its uniform-prior Bayes risk is .
The printed loss is undefined at , despite the stated closed parameter interval. A convention is necessary there. The natural extended loss assigns zero to the correct endpoint decision and infinity to an incorrect one; it gives endpoint risks zero for . Alternatively a continuous extension of this estimator's risk gives endpoint values . The interior result and the minimax value below are unchanged by either convention, and a uniform prior gives the endpoints measure zero. We do not identify an undefined with a value without specifying this choice.
Poisson change-point posterior Created 2026-10-06 Updated 2026-10-14
For an Inhomogeneous Poisson process whose known positive intensity changes from to at an unknown time , the ordered arrival-time likelihood function is
Under a uniform prior, each interval between successive arrivals has an exponential posterior density with rate in the exponent . Its integrated weights allow exact interval selection followed by a truncated exponential draw; when the two rates coincide, the Bayesian posterior is uniform and the data contain no change-time information.
Prior probability Created 2026-09-24 Updated 2026-10-14
Prior probability describes uncertainty before the current observations are incorporated. For a statistical parameter , a prior distribution assigns probabilities to its possible ranges, conditional on background information and a statistical model. A continuous prior density specifies these probabilities through integration:
Here the probability density function is relative to Lebesgue measure ; a discrete prior distribution instead uses a probability mass function and sums. Density at one point is not the probability of that point. A nonnegative kernel with infinite total mass is an improper prior, whose use requires a separate check of posterior propriety.
For the coin model in Bayesian statistics, the beta distribution has prior density on . Its mean is and its variance is . It favors moderate heads probabilities without ruling out values near zero or one. For example,
The prior curve in Bayesian posterior makes this preference visible; moment matching for a beta prior explains how to choose a beta distribution from a desired mean and variance.
A prior distribution lets earlier evidence or elicited knowledge contribute to statistical inference when the current sample size is limited. It also exposes assumptions that can be checked by prior elicitation and a prior predictive check. Before the same eight heads and two tails, a uniform prior would give posterior mean , compared with under : the observations do not uniquely determine a Bayesian posterior. Even a uniform prior makes a choice of parameter coordinates; its child article explains why changing coordinates can destroy uniformity.
Uniform-alternative binomial Bayes factor Created 2026-10-14 Updated 2026-10-25
For a binomial distribution count, compare a point null with the uniform alternative prior distribution on . The alternative Bayesian model evidence is
so the exact Bayes factor favouring the point null is . With standardized deviation , the local normal distribution approximation is . At fixed the frequentist p-value remains approximately constant, while the factor grows like . This demonstrates the prior-width mechanism behind the Jeffreys-Lindley paradox for a Gaussian point null in a discrete sampling model.
For a separate original example, change the point null to and take to have a uniform prior , fixed before the ten Bernoulli trials. Here is drawn once under and shared by all ten trials: they are independent conditional on . For one particular ordered sequence with eight heads and two tails, the Euler beta function gives
Thus the Bayes factor for the uniform alternative against the point null is
The binomial distribution count formulation gives and . Their ratio is again ; these count masses must not be combined with the ordered-sequence masses above. The general formula at the start of this article puts the point null in the numerator, so it equals here.
In contrast, maximum likelihood estimation gives : differentiating the log-likelihood yields , and the endpoints have zero likelihood. Its peak-to-null likelihood ratio is
This peak is chosen after seeing the data, so it is not the Bayes factor of the prespecified . The Bayesian model evidence for averages over its entire uniform prior; it is smaller than the peak. It is also smaller than . Against the same null, a point alternative fixed at would give a Bayes factor about , greater than . An integrated alternative need not outperform a point alternative.
Figure 1.
A uniform-prior average of the likelihood differs from its maximum
. Original calculation for a stipulated ordered sequence with eight heads and two tails. Left: the likelihood function and its uniform prior average , with the point null at and peak at . Right: the average, fixed value, and peak divided by the same null value . Only the first two comparisons use prespecified alternatives; the peak uses a maximum-likelihood estimate. These are calculated model quantities, not measured frequencies. Details.
For a general proper beta distribution prior distribution with , the same ordered-sequence marginal likelihood is . This follows by substituting the normalized prior density into the integral, and shows exactly where the parameter prior distribution changes the Bayes factor. Holding the parameter prior distributions fixed while changing model prior odds leaves that Bayes factor unchanged.
Uniform prior Created 2026-10-05 Updated 2026-10-14
A uniform prior on a finite-volume parameter region assigns constant probability density there and zero outside. On it is , giving a beta distribution posterior after binomial distribution data. Uniformity depends on the coordinate: a nonlinear reparametrization introduces a Jacobian and generally does not preserve a uniform density.