Mathwords logoMathwords

Credible Interval — Definition, Formula & Example

A credible interval is a range of values that, given your data and your prior beliefs, has a stated probability (such as 95%) of containing the unknown quantity you are estimating. It is the Bayesian counterpart of a confidence interval.

Let p(θ∣data)p(\theta \mid \text{data}) be the posterior distribution of a parameter θ\theta. A 100(1−α)%100(1-\alpha)\% credible interval is any interval [a,b][a, b] whose posterior probability is 1−α1-\alpha. Two standard choices exist. The equal-tailed interval puts probability α/2\alpha/2 in each tail. The highest posterior density (HPD) interval is the shortest such interval. Because θ\theta is treated as a random variable, the statement P(a≤θ≤b∣data)=1−αP(a \le \theta \le b \mid \text{data}) = 1-\alpha is a direct probability claim about θ\theta. A confidence interval treats θ\theta as fixed. Its probability describes how often the interval-building method captures θ\theta over repeated samples.

Key Formula

P(a≤θ≤b∣data)=∫abp(θ∣data) dθ=1−αP(a \le \theta \le b \mid \text{data}) = \int_a^b p(\theta \mid \text{data})\,d\theta = 1 - \alpha
Where:
  • θ\theta = The unknown parameter, treated as a random variable
  • a,ba, b = Lower and upper endpoints of the credible interval
  • p(θ∣data)p(\theta \mid \text{data}) = Posterior density of the parameter after seeing the data
  • 1−α1 - \alpha = Credibility level, such as 0.95 for a 95% interval

Worked Example

Problem: A farmer wants the mean weight μ\mu of this year's pumpkins. Past seasons give a prior belief μ∼N(20,22)\mu \sim N(20, 2^2) pounds. She weighs 12 pumpkins and gets a sample mean of 24 pounds. Individual weights have known standard deviation σ=4\sigma = 4 pounds. Find the 95% equal-tailed credible interval for μ\mu.
Step 1: Combine precisions (precision = 1/variance). The prior precision is 1/22=1/41/2^2 = 1/4. The data precision is n/σ2=12/16=3/4n/\sigma^2 = 12/16 = 3/4. For a normal prior with normal data, the posterior precision is their sum.
1τpost2=14+34=1⇒τpost=1\frac{1}{\tau_{\text{post}}^2} = \frac{1}{4} + \frac{3}{4} = 1 \quad\Rightarrow\quad \tau_{\text{post}} = 1
Step 2: The posterior mean is a precision-weighted average of the prior mean and the sample mean. The data carry three times the weight of the prior.
μpost=14(20)+34(24)1=5+18=23\mu_{\text{post}} = \frac{\tfrac{1}{4}(20) + \tfrac{3}{4}(24)}{1} = 5 + 18 = 23
Step 3: The posterior is N(23,12)N(23, 1^2). Cut off 2.5% in each tail using the normal quantile 1.96.
23±1.96(1)  ⇒  (21.04, 24.96)23 \pm 1.96(1) \;\Rightarrow\; (21.04,\ 24.96)
Answer: The 95% credible interval is (21.04, 24.96) pounds. Given the prior and the data, there is a 95% probability that the true mean pumpkin weight lies between 21.04 and 24.96 pounds.

Why It Matters

Credible intervals are the standard output of Bayesian statistics courses and software such as Stan. They let A/B testers and clinical trial teams state directly, "there is a 95% chance the effect lies in this range," which a confidence interval does not justify.

Common Mistakes

Mistake: Treating a credible interval and a confidence interval as interchangeable because their numbers sometimes match.
Correction: With a flat prior and normal data, the endpoints can agree, but the meanings differ. A credible interval is a probability statement about the parameter, given this data and prior. A confidence interval describes the long-run success rate of the method. Change the prior and the credible interval changes. The confidence interval does not.

Related Terms