# Highest-density vs equal-tailed confidence interval

When a sampling distribution is symmetric (and I'm okay assuming unimodal too, if necessary), it's natural to center confidence intervals around the point estimate. But for a skewed distribution (e.g. chi-squared), the endpoints are chosen (in every book I've ever seen) to create a confidence interval analog of the Bayesian equal-tailed interval (ETI) That seems to also be a 'natural' choice. But another natural choice in this context is the shortest confidence interval, the analog of the Bayesian highest-density interval (HDI).

1. Are there real-world scenarios where it makes (more?) sense to use the shortest confidence interval? I'd prefer an example where the statistic is the sample variance.
2. Why aren't these two options for constructing confidence intervals discussed in textbooks?
3. Are there any other 'natural' ways to construct a confidence interval?
• Highest density of what, specifically? In a Bayesian setting this makes sense for a credible interval, because it is based on a single posterior distribution; but not for a confidence interval, because it is determined by a collection of distributions rather than one single distribution. There is a concept of "shortest" CI (for certain families of distributions); that is connected with your question by Calculus as I explain at stats.stackexchange.com/a/127541/919.
– whuber
May 15 at 20:34
• Using variance to make my point: construction of a confidence interval uses the fact that there's a 95% probability that $(n-1)S^2/\sigma^2$ is b/t $\chi^2_{0.975}$ and $\chi^2_{0.025}$. That's where the ETI is used and it seems an HDI could just as well be used. Make sense? May 15 at 20:40
• It makes sense, but it does not correctly characterize confidence intervals: it's an artifact of a specific way of deriving a confidence interval. The point is that the confidence interval is a range of values of a parameter and, in the standard setting, the parameter is not a random variable and therefore has no distribution or density.
– whuber
May 15 at 20:43
• Maybe I'm just misusing terms. My question could just as well have been about the shortest confidence interval; for variance the usual CI and the shortest CI will disagree. Right? Why isn't the shortest (ever? commonly?) used? May 15 at 20:47
• You buy a light-bulb and are told its life-time is exponentially distributed with median life 10 years (and expectation just over 14 years). It breaks on the first day: are you surprised about such an unlikely short life (probability less than 0.03%), or not surprised at all since that was the most likely outcome? May 16 at 13:36

#### You can construct shortest CIs in a manner similar to HDIs

You can find this issue discussed in O'Neill (2021) and you can find resulting algorithms for the shortest CI in the stat.extend package in R. There is a close mathematical analogy between the HDI and the shortest confidence interval, but care must be taken when constructing the latter. Typically a CI is constructed from a pivotal quantity with a known fixed distribution, so we can form a valid CI using any weighting we wish on the relative sizes of the tails of the pivotal distribution. By "inverting" a probability statement in relation to the pivotal distribution we obtain a general form for the CI, and we can then optimise to construct the shortest CI by putting unequal weight in the tails. This is slightly different to computing a HDI because in the case of the shortest CI we are optimising for shortest interval length (after "inversion" of a probability statement") rather than optimising for shortest interval length within the highest density region of the distribution. Sometimes these things correspond and sometimes they give slightly different results.

You can find a general discussion of shortest CIs in this related answer and I will repeat some of that discussion here. For the variance example of interest to you, suppose we observe data $$X_1,...,X_n \sim \text{IID N}(\mu, \sigma^2)$$ known to come from a normal distribution with unknown parameters, and we want to form a CI for the standard deviation parameter $$\sigma$$. To do this we can use the well-known pivotal quantity:

$$\sqrt{n-1} \cdot \frac{S_n}{\sigma} \sim \text{Chi}(n-1).$$

Suppose we let $$\chi_{n-1, \alpha}$$ denote the critical point of the chi distribution with $$n-1$$ degrees-of-freedom and with upper tail $$\alpha$$. Using the above pivotal quantity, and choosing any value $$0 \leqslant \theta \leqslant \alpha$$, we have:

\begin{align} 1-\alpha &= \mathbb{P} \Bigg( \chi_{n-1, \theta} \leqslant \sqrt{n-1} \cdot \frac{S_n}{\sigma} \leqslant \chi_{n-1, 1-\alpha+\theta} \Bigg) \\[6pt] &= \mathbb{P} \Bigg( \frac{\sqrt{n-1} \cdot S_n}{\chi_{n-1, 1-\alpha+\theta}} \leqslant \sigma \leqslant \frac{\sqrt{n-1} \cdot S_n}{\chi_{n-1, \theta}} \Bigg), \\[6pt] \end{align}

giving the confidence interval:

$$\text{CI}_{\sigma}(1-\alpha) = \Bigg[ \frac{\sqrt{n-1} \cdot s_n}{\chi_{n-1, 1-\alpha+\theta}}, \ \frac{\sqrt{n-1} \cdot s_n}{\chi_{n-1, \theta}} \Bigg],$$

with length function:

$$\text{Length}(\theta) = \Bigg( \frac{1}{\chi_{n-1, \theta}} - \frac{1}{\chi_{n-1, 1-\alpha+\theta}} \Bigg) \cdot \sqrt{n-1} \cdot s_n.$$

This function can be minimised numerically to yield the minimising value $$\hat{\theta}$$ (which will depend on the sample size and significance level), which gives the optimal (shortest) confidence interval for the population standard deviation. Unlike in the case of a confidence interval for the population mean, the optimal interval in this case does not have equal tail areas for the upper and lower tail. This problem is examined in Tate and Klett (1959), where the authors look at the corresponding interval for the population variance. This confidence interval can be programmed using the CONF.var function in the stat.extend package.

#Compute 95% confidence interval for the variance
CONF.var(alpha = 0.05, x = DATA, kurt = 3)

Confidence Interval (CI)

95.00% CI for variance parameter for infinite population
Interval uses 60 data points from data DATA with sample variance = 6.5818
and assumed kurtosis = 3.0000
Computed using nlm optimisation with 8 iterations (code = 3)

[4.50233916286611, 9.41710949707062]


• Mahalo, Ben! Do you know of any real world situations where the shortest CI is preferred over the equal-tailed one? I'm looking for a good example to show my students. May 15 at 23:58
• It's not really a matter of real-world situations; this is a methodological choice that can be used (or not used) when forming the CI in any real-world situation where you want to employ a CI.
– Ben
May 16 at 4:05
• Are there any interesting reasons for choosing the shortest CI? (Besides that it's more precise.) May 16 at 6:39
1. Shortest confidence interval would often be preferred over equal tails for the cases where zero or n successes are observed from n attempts in a Bernoulli system. The shortest interval would include the observed success probability whereas the equal tailed intervals would not.

2. I certainly don't know why the various options for interval design are omitted from textbooks, but the desire for clarity must play a part. You will rarely see discussion of the various arbitrary conventions associated with frequentist statistical methods in textbooks, perhaps because the arbitrariness is embarrassing.