Actuarial Statistics · Bayesian inference: priors, posteriors, loss functions and credible intervals
Bayesian Credible Intervals: Construction and Interpretation
Updated 11 October 2026 · Fact-checked
A Bayesian credible interval is a range that contains the parameter with a stated posterior probability, such as 95%. You find it from the posterior distribution by taking quantiles (equal-tailed) or the region of highest density (HPD). It is a direct probability statement about the parameter, unlike a confidence interval.
Understand Bayesian Credible Intervals
In Bayesian inference the parameter θ is treated as a random variable. You start with a prior f(θ), combine it with the data through the likelihood, and get the posterior f(θ | x). The posterior holds everything you know about θ after seeing the data.
A credible interval summarises the posterior as a range. A 100(1 − α)% credible interval (a, b) satisfies P(a < θ < b | x) = 1 − α. So for a 95% interval you can say: given the data and the prior, the probability that θ lies in (a, b) is 0.95. This is the statement most people wish a confidence interval gave them.
Many intervals have the same posterior probability, so you need a rule to choose one. The equal-tailed interval puts α/2 probability in each tail. Its limits are the α/2 and 1 − α/2 quantiles of the posterior. The highest posterior density (HPD) interval is the shortest interval with probability 1 − α. Every point inside it has higher posterior density than every point outside it. For a symmetric, unimodal posterior (such as the normal) the two intervals are the same. For a skewed posterior, such as a gamma, they differ, and the HPD interval is shorter.
A classical confidence interval is different. The parameter is a fixed unknown constant and the interval is random. The 95% refers to the procedure: if you repeated the sampling many times, about 95% of the intervals built this way would contain the true θ. For one calculated interval you cannot say there is a 95% probability that θ is inside it. With a normal posterior and a very vague prior, the numbers can look alike, but the meaning stays different.
Key rules to remember
- Posterior (proportional form)
- f(θ | x) ∝ f(x | θ) × f(θ)
- Identify the posterior's family by looking at the kernel, then use known quantiles of that distribution.
- Credible interval definition
- P(a < θ < b | x) = ∫ from a to b of f(θ | x) dθ = 1 − α
- This is a probability statement about θ given the observed data.
- Equal-tailed interval
- P(θ < a | x) = α/2 and P(θ > b | x) = α/2
- a and b are the α/2 and 1 − α/2 posterior quantiles.
- HPD interval
- Set {θ : f(θ | x) ≥ k}, with k chosen so that its posterior probability is 1 − α
- Shortest interval of that probability. For a unimodal posterior it is a single interval with f(a | x) = f(b | x).
- Normal posterior interval
- μ₁ ± z(1−α/2) × σ₁, where θ | x ~ N(μ₁, σ₁²)
- For 95%, z = 1.96. Equal-tailed and HPD coincide here.
- Normal–normal posterior
- Prior N(μ₀, σ₀²), data mean x̄ from n observations with known variance σ²: posterior precision = 1/σ₀² + n/σ²; posterior mean = (μ₀/σ₀² + n x̄/σ²) ÷ posterior precision
- Precision is 1 ÷ variance. Posterior variance = 1 ÷ posterior precision.
How to solve Bayesian Credible Intervals questions
Use this method for any question that asks for a credible interval or asks you to compare it with a confidence interval.
- 1Write down the prior and the likelihood. State any assumptions, such as known variance or independent observations.
- 2Multiply them and keep only the terms involving θ to get the posterior kernel.
- 3Identify the posterior distribution and its parameters (for example, gamma, beta or normal).
- 4Decide the interval type. Use equal-tailed unless the question asks for HPD.
- 5Find the required quantiles from the tables or from R (qgamma, qbeta, qnorm). For a normal posterior use mean ± z × standard deviation.
- 6State the interval and interpret it: the posterior probability that θ lies in it is 1 − α, given the data and the prior.
- 7If asked, compare with the classical confidence interval: the parameter is fixed there and the 1 − α describes the long-run behaviour of the method.
Quickest way: Normal posterior shortcut
When to use it: Use it when the prior is normal and the data are normal with known variance, or when the question states that the posterior is normal.
- Add the precisions: 1/σ₀² + n/σ².
- Posterior variance is the reciprocal of that sum.
- Posterior mean is the precision-weighted average of μ₀ and x̄.
- Interval = posterior mean ± 1.96 × posterior standard deviation for 95%.
- Check the answer lies between the prior mean and x̄ and that the width is narrower than the interval from data alone.
Common mistakes in Bayesian Credible Intervals
Interpreting a 95% confidence interval as a 95% probability that θ is in the interval.
The wording is similar to the credible interval and the natural reading sounds right.
Fix: Say the 95% describes the long-run coverage of the method. Reserve the probability statement about θ for credible intervals.
Using the equal-tailed interval when the question asks for HPD, or assuming they are always equal.
They coincide for symmetric unimodal posteriors, so students assume it holds in general.
Fix: Check the shape of the posterior. If it is skewed, the HPD interval is shorter and has equal density at both ends, not equal tail probabilities.
Adding variances instead of precisions when combining a normal prior and normal data.
Students mix this up with the variance of a sum.
Fix: Add precisions (1/variance). Then invert to get the posterior variance.
Forgetting that the data mean has variance σ²/n, not σ².
Students use the single-observation variance in the likelihood.
Fix: Use n/σ² as the data precision when working with x̄ from n observations.
Taking quantiles of the prior or the likelihood instead of the posterior.
The prior is written first and is easy to pick up by accident.
Fix: Name the posterior distribution with its parameters before looking up any quantile.
Not stating the interpretation in words.
Students focus on the calculation.
Fix: End every answer with one sentence: given the data and prior, the posterior probability that θ lies in (a, b) is 1 − α.
Worked examples
Example 1
The prior for a mean claim size θ (in ₹ thousand) is N(50, 10²). You observe n = 4 claims with sample mean 58. Claim sizes are N(θ, 8²) with σ² = 64 known. Find the 95% credible interval for θ.
Show the solution
- Prior precision = 1/100 = 0.01.
- Data precision = n/σ² = 4/64 = 0.0625.
- Posterior precision = 0.01 + 0.0625 = 0.0725. Posterior variance = 1/0.0725 = 13.7931.
- Posterior mean = (50 × 0.01 + 58 × 0.0625) ÷ 0.0725 = (0.5 + 3.625) ÷ 0.0725 = 4.125 ÷ 0.0725 = 56.8966 (about 56.90).
- Posterior standard deviation = √13.7931 = 3.7139.
- Interval = 56.8966 ± 1.96 × 3.7139 = 56.8966 ± 7.2792 = (49.62, 64.18).
Answer: The 95% credible interval is approximately (49.62, 64.18) in ₹ thousand, i.e. ₹49,620 to ₹64,180. Given the data and prior, the probability that θ lies in this interval is 0.95.
Example 2
The number of claims in a year is Poisson(λ). The prior for λ is gamma with shape 2 and rate 1. In one year you observe 3 claims. Find the posterior distribution and give the posterior mean. State whether the equal-tailed and HPD intervals would be the same.
Show the solution
- The likelihood is proportional to λ³ e^(−λ).
- The prior is proportional to λ^(2−1) e^(−λ) = λ e^(−λ).
- Posterior ∝ λ⁴ e^(−2λ), which is a gamma kernel with shape 5 and rate 2.
- Posterior mean = shape ÷ rate = 5/2 = 2.5.
- A gamma distribution with shape greater than 1 is right-skewed, not symmetric.
Answer: The posterior is gamma(5, 2) with mean 2.5. Because the posterior is skewed, the equal-tailed interval and the HPD interval would differ, and the HPD interval would be shorter.
Exam tips
- Always write the interpretation sentence. Examiners often give marks for it separately.
- In comparison questions, make two points: what is random (θ in the Bayesian case, the interval in the classical case) and what the percentage means.
- Know when equal-tailed and HPD coincide: symmetric unimodal posteriors.
- Work with precisions in normal–normal questions. It is quicker and reduces errors.
- For computer-based papers, use qgamma or qbeta with the posterior parameters for equal-tailed intervals, and state the code and result.
Practice questions from Bayesian inference: priors, posteriors, loss functions and credible intervals
- A prior distribution for a parameter θ is combined with data x. Which statement correctly describes the Bayesian relationship between the po…
- The posterior of θ is discrete: P(θ=1)=0.2, P(θ=2)=0.5, P(θ=4)=0.3. Under all-or-nothing (0-1) loss, the Bayes estimate of θ is:
- The posterior distribution of a mean μ is Normal with mean 52 and variance 16. What is the equal-tailed 95% Bayesian credible interval for μ…
- Which statement about an improper prior such as f(θ) ∝ 1 for a normal mean θ (variance known) is correct?
- The prior for θ is Beta(2, 6). In 10 independent trials with success probability θ, 4 successes are observed. Under quadratic (squared error…
Bayesian Credible Intervals: frequently asked questions
How do I calculate a Bayesian credible interval?
Find the posterior distribution of the parameter, then take its α/2 and 1 − α/2 quantiles for an equal-tailed interval. For a normal posterior, use the mean plus or minus z times the standard deviation. State the interval and its interpretation.
What is the difference between a credible interval and a confidence interval?
A credible interval gives the posterior probability that the parameter lies in it, given the data and prior. A confidence interval describes the long-run proportion of such intervals that would contain the fixed true parameter. The first is a statement about θ, the second about the method.
What is the difference between HPD and equal-tailed intervals?
An equal-tailed interval leaves the same probability in each tail. An HPD interval is the shortest interval with the required probability and has equal density at its ends. They are the same for symmetric unimodal posteriors and differ for skewed ones.
Can a credible interval and a confidence interval be numerically the same?
Yes, in some cases. For a normal mean with known variance and a very vague (flat) prior, the 95% credible interval has the same limits as the classical interval. The interpretations still differ.