Statistical Calculators › Bayesian Sample Size Methods › Bayesian Sample Size for Credible Interval Width
← All Calculators

Bayesian Sample Size Methods

Bayesian Sample Size for Credible Interval Width

Determines the minimum sample size required for a normal-normal Bayesian analysis to achieve a specified posterior credible interval width for a population mean. The calculation incorporates the prior precision and the known sampling variance directly, so informative prior information can reduce the number of new observations required.

Design Parameters

Normal likelihood with known variance and a Normal prior for the mean. The prior mean affects the posterior location, but not the required sample size for a target interval width.
Both standard deviations must use the same measurement units as the endpoint.

Required Sample Size

The result is the smallest integer n for which the posterior equal-tailed credible interval is no wider than the requested target.
Enter the design parameters and click Calculate Sample Size.

Methodology

This calculator implements the normal-normal Bayesian credible-interval width criterion for estimating a single normal mean when the sampling variance is known. This is one of the normal-mean Bayesian sample-size settings described by Joseph and Bélisle, who developed Bayesian sample size criteria based on posterior credible-interval length and coverage. The official nQuery Bayes documentation likewise identifies Bayesian interval procedures as sample-size methods for obtaining a desired credible-interval width.

Posterior precision

Let the observations have known standard deviation σ, and let the prior distribution for the population mean be μ ∼ N(μ0, τ02). After n observations, the posterior distribution is normal with variance:

σpost2 = 1 / ( n / σ2 + 1 / τ02 )

For a central credible level γ, the equal-tailed credible interval has full width:

W(n) = 2 z(1+γ)/2 σpost

Setting this width equal to the target W and solving for n gives the required continuous sample-size threshold:

n* = σ2 [ 4 z(1+γ)/22 / W2 − 1 / τ02 ]

The calculator rounds this threshold upward to the smallest integer sample size that actually satisfies the width requirement. If the prior alone already produces a credible interval no wider than the target, the required additional sample size is zero.

Prior effective sample size

In this known-variance formulation, the prior contributes precision equivalent to:

nprior = σ2 / τ02

Thus a more concentrated prior contributes more effective prior information and can reduce the number of new observations required. The prior mean does not enter the width calculation because changing the prior location shifts the posterior but does not change posterior variance.

Worked validation example

The CRAN documentation for the SampleSizeMeans implementation of Joseph and Bélisle's methods gives the example mu.varknown(len=0.2, lambda=1/4, n0=10), with the desired credible-interval length equal to 0.20, sampling precision λ = 1/4, and prior sample-size equivalent n0 = 10. Translating these inputs gives σ = 2 and τ0 = 2/√10 = 0.6324555.

Target width = 0.20  ·  σ = 2  ·  τ0 = 0.6324555  ·  γ = 0.95  →  Required n = 1,527

At n = 1,527, the calculated posterior credible-interval width is approximately 0.199973, while at n = 1,526 it remains above 0.20. Therefore 1,527 is the first integer sample size satisfying the specified precision criterion.

Scope and interpretation

This calculator is specifically the known-variance normal-normal credible-width formulation. Bayesian sample-size methods for unknown variance, binomial proportions, treatment differences, highest posterior density intervals, assurance, or other endpoints require different calculations and should not be substituted into this formula.

References

Joseph, L. & Bélisle, P. (1997). Bayesian sample size determination for normal means and differences between normal means. The Statistician, 46(2), 209–226.

https://doi.org/10.1111/1467-9884.00077

SampleSizeMeans R package documentation, including mu.varknown, which implements Bayesian sample-size determination for a normal mean with known variance and a prior sample-size equivalent.

CRAN/R documentation: mu.varknown

nQuery / Statsols. Sample Size for Bayesian Statistics. The nQuery Bayes documentation identifies Bayesian interval procedures for determining sample size from a desired credible-interval width.

nQuery Bayes documentation