Tutorials › Statistical Learning (Graduate) › One-Sided and Two-Sided Hoeffding Confidence Bounds

Concentration for Learning · Tutorial 101 of 989

One-Sided and Two-Sided Hoeffding Confidence Bounds

Turn Hoeffding tail probabilities into upper and lower confidence limits, and see precisely why two-sided coverage requires a larger radius.

Beginner 10 min read

What You'll Learn

  • Define one-sided and two-sided Hoeffding confidence bounds for a bounded mean.
  • Choose a radius from a target failure probability by inverting the tail inequality.
  • Distinguish which tail produces an upper limit and which produces a lower limit.
  • Compare one-sided and two-sided radii at the same confidence level.
  • Allocate failure probabilities to construct asymmetric bounds with joint coverage.

From Tail Probabilities to Confidence Limits

Hoeffding’s inequality controls how far a sample average of bounded independent observations can deviate from its mean. A confidence bound uses that deviation statement in reverse: choose a tolerated failure probability, solve for the corresponding deviation radius, and report a limit that covers the unknown mean with at least the desired probability. The direction of the tail matters. An upper limit for the mean is obtained from the lower tail of the sample average, and a lower limit is obtained from its upper tail.

Assume \(X_1,\ldots,X_n\) are independent observations, each taking values in the same known interval \([a,b]\), where \(a<b\), and with common mean \(\mu=E[X_i]\). Write \(\bar X_n=n^{-1}\sum_{i=1}^n X_i\). For this setting, Hoeffding’s inequality gives, for every \(t>0\),

$$ P(\bar X_n-\mu\geq t)\leq \exp\left(-\frac{2nt^2}{(b-a)^2}\right), \qquad P(\bar X_n-\mu\leq -t)\leq \exp\left(-\frac{2nt^2}{(b-a)^2}\right). $$

A confidence statement is a repeated-sampling guarantee: the data, and hence the reported bound, vary from sample to sample, while \(\mu\) is fixed. The guarantee says how often the reported bound covers that fixed mean under the assumptions above.

Inverting a One-Sided Tail

Let \(0<\delta<1\) be the allowed failure probability. To make the right side of either Hoeffding tail inequality equal to \(\delta\), solve for \(t\):

$$ \exp\left(-\frac{2nt^2}{(b-a)^2}\right)=\delta \quad\Longrightarrow\quad t=r_n(\delta):=(b-a)\sqrt{\frac{\log(1/\delta)}{2n}}. $$

The upper confidence limit comes from the event that the sample average falls too far below the mean. If \(\mu>\bar X_n+r_n(\delta)\), then \(\bar X_n-\mu<-r_n(\delta)\). Hoeffding’s lower-tail inequality therefore bounds the probability that this upper limit misses.

Theorem: Under the independent, common-mean, bounded-observation assumptions above, define \(U_\delta=\bar X_n+(b-a)\sqrt{\log(1/\delta)/(2n)}\) and \(L_\delta=\bar X_n-(b-a)\sqrt{\log(1/\delta)/(2n)}\). Then \(P(\mu\leq U_\delta)\geq1-\delta\) and \(P(\mu\geq L_\delta)\geq1-\delta\). These are, respectively, an upper and a lower one-sided Hoeffding confidence bound.

Proof. The event \(\{\mu>U_\delta\}\) is exactly \(\{\bar X_n-\mu<-r_n(\delta)\}\), which is contained in \(\{\bar X_n-\mu\leq-r_n(\delta)\}\). Thus

$$ P(\mu>U_\delta) \leq \exp\left(-\frac{2n r_n(\delta)^2}{(b-a)^2}\right) =\exp(-\log(1/\delta)) =\delta. $$

Consequently \(P(\mu\leq U_\delta)\geq1-\delta\). Similarly, \(\{\mu<L_\delta\}=\{\bar X_n-\mu>r_n(\delta)\}\), which is contained in \(\{\bar X_n-\mu\geq r_n(\delta)\}\). The upper-tail inequality gives \(P(\mu<L_\delta)\leq\delta\), hence \(P(\mu\geq L_\delta)\geq1-\delta\). \(\square\)

Because \(\mu\in[a,b]\), the limits may be tightened without reducing coverage: use \(\min\{b,U_\delta\}\) as the upper limit and \(\max\{a,L_\delta\}\) as the lower limit. The untrimmed formulas are often simpler to work with, and either form gives the stated one-sided guarantee.

Worked Example: A One-Sided Bound for a Binary Mean

Suppose \(n=25\) independent patients each have a binary outcome \(X_i\in\{0,1\}\), and 16 outcomes equal 1. The sample mean is \(\bar X_{25}=16/25=0.64\). Since the observations lie in \([0,1]\), take \(b-a=1\). Find a 90% upper confidence bound for the population mean \(\mu\).

Here the one-sided failure probability is \(\delta=0.10\). The radius is

$$ r_{25}(0.10)=\sqrt{\frac{\log(10)}{2(25)}} =\sqrt{\frac{2.302585}{50}} =\sqrt{0.0460517} \approx 0.2146. $$

Thus \(U_{0.10}=0.64+0.2146=0.8546\), so \(P(\mu\leq0.8546)\geq0.90\). The result is conservative: it guarantees at least 90% coverage, not necessarily exactly 90%. The limit is already within the known parameter range \([0,1]\).

Two-Sided Coverage and the Radius Cost

A two-sided interval must control both ways the sample mean can differ from \(\mu\). The event that the interval \([\bar X_n-r,\bar X_n+r]\) misses \(\mu\) is contained in the union of the upper-tail and lower-tail deviation events. The union bound adds their failure probabilities.

Theorem: Under the same assumptions, for \(0<\delta<1\), let \(r_{n,2}(\delta)=(b-a)\sqrt{\log(2/\delta)/(2n)}\). Then \(P\bigl(\mu\in[\bar X_n-r_{n,2}(\delta),\bar X_n+r_{n,2}(\delta)]\bigr)\geq1-\delta\).

Proof. If \(|\bar X_n-\mu|>r\), then either \(\bar X_n-\mu>r\) or \(\bar X_n-\mu<-r\). Applying the two Hoeffding bounds and the union bound,

$$ P(|\bar X_n-\mu|>r) \leq 2\exp\left(-\frac{2nr^2}{(b-a)^2}\right). $$

Set \(r=r_{n,2}(\delta)\). Then the right side is \(2\exp[-\log(2/\delta)]=\delta\). Therefore the probability that \(\mu\) lies in the interval is at least \(1-\delta\). \(\square\)

For the same nominal confidence level \(1-\delta\), the two-sided radius is larger than the one-sided radius:

$$ \frac{r_{n,2}(\delta)}{r_n(\delta)} =\sqrt{\frac{\log(2/\delta)}{\log(1/\delta)}}>1. $$

The increase comes from protecting against two tails rather than one. It is not a change in the boundedness assumption or the sample size. As \(\delta\) becomes small, the ratio approaches 1, but for any \(0<\delta<1\) it is strictly greater than 1.

Worked Example: Comparing One- and Two-Sided 95% Bounds

Suppose \(n=36\), each observation lies in \([2,8]\), and the observed average is \(\bar X_{36}=5.1\). The range width is \(b-a=6\). Compute an upper one-sided 95% bound and a two-sided 95% interval.

For the one-sided upper bound, \(\delta=0.05\), so

$$ r_{36}(0.05) =6\sqrt{\frac{\log(20)}{72}} =6\sqrt{\frac{2.995732}{72}} =6\sqrt{0.0416074} \approx 1.224. $$

The upper limit is \(5.1+1.224=6.324\), giving \(P(\mu\leq6.324)\geq0.95\).

For two-sided 95% coverage, use \(\log(2/0.05)=\log(40)\):

$$ r_{36,2}(0.05) =6\sqrt{\frac{\log(40)}{72}} =6\sqrt{\frac{3.688879}{72}} =6\sqrt{0.0512344} \approx1.358. $$

The interval is \([5.1-1.358,\;5.1+1.358]=[3.742,\;6.458]\), with coverage at least 95%. Its radius is larger than the one-sided radius because it protects both tails.

Different Error Allocations for Asymmetric Limits

The two sides do not have to receive equal failure probabilities. Suppose an upper bound is required to fail with probability at most \(\delta_U\), and a lower bound with probability at most \(\delta_L\). Applying the one-sided result separately and then using the union bound gives simultaneous coverage of at least \(1-\delta_U-\delta_L\). The resulting interval can therefore have different distances from \(\bar X_n\) on its two sides.

Worked Example: An Asymmetric Interval with 95% Joint Coverage

Let \(n=64\), \(X_i\in[0,10]\), and \(\bar X_{64}=3.2\). We want an upper bound with 99% one-sided confidence and a lower bound with 96% one-sided confidence. Their failure probabilities are \(\delta_U=0.01\) and \(\delta_L=0.04\).

The upper radius is

$$ r_U=10\sqrt{\frac{\log(100)}{128}} =10\sqrt{\frac{4.605170}{128}} \approx1.897, \qquad U=3.2+1.897=5.097. $$

The lower radius is

$$ r_L=10\sqrt{\frac{\log(25)}{128}} =10\sqrt{\frac{3.218876}{128}} \approx1.586, \qquad L=3.2-1.586=1.614. $$

The upper claim has failure probability at most 0.01, and the lower claim at most 0.04. By the union bound, both claims hold together with probability at least \(1-0.01-0.04=0.95\). Thus \([1.614,5.097]\) is a 95% joint-coverage interval, with unequal radii because the error probabilities were allocated unequally.

Common Pitfall: Using the One-Sided Radius Twice

A frequent error is to calculate a radius using \(\log(1/\delta)\), then claim that the interval extending that distance in both directions has coverage \(1-\delta\). That radius makes each tail probability at most \(\delta\), so the union bound only guarantees total failure probability at most \(2\delta\). For a two-sided failure budget of \(\delta\), assign at most \(\delta/2\) to each tail; equivalently, use the radius involving \(\log(2/\delta)\).

The radius also depends on the known range width \(b-a\) and on \(n\): it grows linearly with the range width and decreases at the rate \(1/\sqrt n\). A confidence level alone does not determine a numerical bound. The observations’ range, sample size, and observed average are all needed.

Key takeaway: A one-sided bound spends the entire failure budget on one tail and uses radius \((b-a)\sqrt{\log(1/\delta)/(2n)}\). A two-sided interval must protect both tails and uses radius \((b-a)\sqrt{\log(2/\delta)/(2n)}\) for total failure probability \(\delta\).

Check Your Understanding

Use the definitions and guarantees above to answer the following questions.

  1. For an upper confidence bound on \(\mu\), which deviation tail of \(\bar X_n-\mu\) controls the failure event, and why?
  2. For observations in \([a,b]\), write the radius of a one-sided bound with failure probability \(\delta\).
  3. Explain why using a one-sided radius on both sides does not, by itself, guarantee two-sided coverage \(1-\delta\).
  4. How does the two-sided radius compare with the one-sided radius at the same \(\delta\), and what accounts for the difference?
  5. If upper and lower failure probabilities are \(\delta_U\) and \(\delta_L\), what joint coverage is guaranteed by the union bound?
Clinical Biostats