Confidence Interval and Hypothesis Test Duality
Beyond both being statistical decision-making procedures, confidence intervals and hypothesis tests have a stronger connection. The one direction of the duality is easy: given a confidence interval for the parameter, we can construct a hypothesis test . Essentially, the confidence region corresponds to the rejection region of the hypothesis test.
For the other direction, we consider a family of tests , each of which rejects the null hypothesis with probability . That is, the family of tests test against all possible values of the parameter . Then, we can construct a confidence interval
Recall the definition of the level of a Hypothesis Testing. We have
indicating that is indeed a level confidence interval. In other words, to build a level CI, we collect all parameters that are consistent enough with the data, i.e., those that do not reject of the simple null hypothesis at level .
Algorithm for HT to CI
We give an example algorithm for constructing CI through HT. Our goal is to construct a CI with balanced coverage: .
Algorithm
- Input: level
- For :
- Generate a -test on HT against .
- Generate a -test on HT against .
- Return:
One can check that the above method returns a finite-sample valid CI.
HT CI for a Few Bernoulli Trials
We construct a Confidence Interval for the parameter given a few Bernoulli Trials to demonstrate how HT-based CI adapts to the number of samples and is finite-sample valid.
First, we note that when we only have a few samples, it’s more likely we observe extreme events like or . In such cases, non-inclusive Wald CI gives an degenerated CI:
which is obviously not valid.
We now examine the HT-based CI constructed by Algorithm for HT to CI under such extreme events. Consider trials from . Since the Binomial Distribution has a monotone likelihood function, we know the UMP level- test is
where is the -quantile of . Now suppose . We need to find the parameter such that
where the second equality uses the fact that . Although the general binomial quantile function is hard to express, in such extreme events, we have
Therefore, we get the CI
which is not degenerated and is valid.