# 0.7 Chernoff's bound and hoeffding's inequality  (Page 2/2)

 Page 2 / 2

Take

$Z=|\stackrel{^}{{R}_{n}\left(f\right)}-R\left(f\right)|\phantom{\rule{4.pt}{0ex}}\phantom{\rule{4.pt}{0ex}}\text{and}\phantom{\rule{4.pt}{0ex}}\phantom{\rule{4.pt}{0ex}}t=ϵ$
$\begin{array}{ccc}\hfill P\left(|\stackrel{^}{{R}_{n}}\left(f\right)-R\left(f\right)|\ge ϵ\right)& \le & \frac{E\left[|\stackrel{^}{{R}_{n}\left(f\right)}-R\left(f\right){|}^{2}\right]}{{ϵ}^{2}}\hfill \\ & \le & \frac{\text{var}\left({\stackrel{^}{R}}_{n}\left(f\right)\right)}{{ϵ}^{2}}\hfill \\ & =& \frac{{\sum }_{i=1}^{n}\text{var}\left(\frac{{L}_{i}}{n}\right)}{{ϵ}^{2}}\hfill \\ & =& \frac{\text{var}\left(\ell \left(X\right),Y\right)}{n{ϵ}^{2}}\hfill \\ & =& \frac{{\sigma }_{L}^{2}}{n{ϵ}^{2}}\hfill \end{array}.$

So, the probability goes to zero at a rate of at least ${n}^{-1}$ . However, it turns out that this is an extremely loose bound. Accordingto the Central Limit Theorem

$\stackrel{^}{{R}_{n}}\left(f\right)=\frac{1}{n}\sum _{i=1}^{n}{L}_{i}\to N\left(R,\left(f\right),,,\frac{{\sigma }_{L}^{2}}{n}\right)\phantom{\rule{4.pt}{0ex}}\phantom{\rule{4.pt}{0ex}}\text{as}\phantom{\rule{4.pt}{0ex}}\phantom{\rule{4.pt}{0ex}}n\to \infty$

in distribution. This suggests that for large values of n,

$P\left(|\stackrel{^}{{R}_{n}}\left(f\right)-R\left(f\right)|\ge ϵ\right)\approx O\left({e}^{-\frac{n{ϵ}^{2}}{2{\sigma }_{L}^{2}}}\right).$

That is, the Gaussian tail probability is tending to zero exponentially fast.

## Chernoff's bound

Note that for any nonnegative random variable $Z$ and $t>0$ ,

$P\left(Z\ge t\right)=P\left({e}^{sZ}\ge {e}^{st}\right)\le \frac{E\left[{e}^{sZ}\right]}{{e}^{st}},\phantom{\rule{4pt}{0ex}}\forall s>0\phantom{\rule{4.pt}{0ex}}\text{by}\phantom{\rule{4.pt}{0ex}}\text{Markov's}\phantom{\rule{4.pt}{0ex}}\text{inequality}.$

Chernoff's bound is based on finding the value of $s$ that minimizes the upper bound. If $Z$ is a sum of independent random variables. For example, say

$Z=\sum _{i=1}^{n}\left(\ell ,\left(f\left({X}_{i}\right),{Y}_{i}\right),-,R,\left(f\right)\right)=n\left({\stackrel{^}{R}}_{n},\left(f\right),-,R,\left(f\right)\right)$

then the bound becomes

$P\left(\sum _{i=1}^{n},\left({L}_{i}-E\left[{L}_{i}\right]\right),\ge ,t\right)\le {e}^{-st}E\left[{e}^{s{\sum }_{i=1}^{n}\left({L}_{i}-E\left[{L}_{i}\right]\right)}\right]\le {e}^{-st}\prod _{i=1}^{n}E\left[{e}^{s\left({L}_{i}-E\left[{L}_{i}\right]\right)}\right],\phantom{\rule{4.pt}{0ex}}\text{from}\phantom{\rule{4.pt}{0ex}}\text{independence.}$

Thus, the problem of finding a tight bound boils down to finding a good bound for $E\left[{s}^{s\left({L}_{i}-E\left[{L}_{i}\right]\right)}\right]$ . Chernoff ('52), first studied this situation for binary random variables. Then,Hoeffding ('63) derived a more general result for arbitrary bounded random variables.

Theorem

## Hoeffding's inequality

Let ${Z}_{1},{Z}_{2},...,Zn$ be independent bounded random variables such that ${Z}_{i}\in \left[{a}_{i},{b}_{i}\right]$ with probability 1. Let ${S}_{n}={\sum }_{i=1}^{n}{Z}_{i}$ . Then for any $t>0$ , we have

$P\left(|{S}_{n}-E\left[{S}_{n}\right]|\ge t\right)\le 2{e}^{-\frac{2{t}^{2}}{{\sum }_{i=1}^{n}{\left({b}_{i}-{a}_{i}\right)}^{2}}}.$

The key to proving Hoeffding's inequality is the following upper bound: if $Z$ is a random variable with $E\left[Z\right]=0$ and $a\le Z\le b,$ then

$E\left[{e}^{sZ}\right]\le {e}^{\frac{{s}^{2}{\left(b-a\right)}^{2}}{8}}.$

This upper bound is derived as follows. By the convexity of theexponential function,

${e}^{sz}\le \frac{z-a}{b-a}{e}^{sb}+\frac{b-z}{b-a}{e}^{sa},\phantom{\rule{4.pt}{0ex}}\text{for}\phantom{\rule{4.pt}{0ex}}a\le z\le b.$

Thus,

$\begin{array}{ccc}\hfill E\left[{e}^{sZ}\right]& \le & E\left[\frac{Z-a}{b-a}\right]{e}^{sb}+E\left[\frac{b-Z}{b-a}\right]{e}^{sa}\hfill \\ & =& \frac{b}{b-a}{e}^{sa}-\frac{a}{b-a}{e}^{sb}\phantom{\rule{4.pt}{0ex}}\text{,}\phantom{\rule{4.pt}{0ex}}\phantom{\rule{4.pt}{0ex}}\text{since}\phantom{\rule{4.pt}{0ex}}E\left[Z\right]=0\hfill \\ & =& \left(1-\theta +\theta {e}^{s\left(b-a\right)}\right){e}^{-\theta s\left(b-a\right)}\phantom{\rule{4.pt}{0ex}}\text{,}\phantom{\rule{4.pt}{0ex}}\phantom{\rule{4.pt}{0ex}}\text{where}\phantom{\rule{4.pt}{0ex}}\theta =\frac{-a}{b-a}\hfill \end{array}.$

Now let

$u=s\left(b-a\right)\phantom{\rule{4.pt}{0ex}}\phantom{\rule{4.pt}{0ex}}\text{and}\phantom{\rule{4.pt}{0ex}}\text{define}\phantom{\rule{4.pt}{0ex}}\phantom{\rule{4.pt}{0ex}}\phi \left(u\right)\equiv -\theta u+log\left(1-\theta +\theta {e}^{u}\right).$

Then we have

$E\left[{e}^{sZ}\right]\le \left(1-\theta +\theta {e}^{s\left(b-a\right)}\right){e}^{-\theta s\left(b-a\right)}={e}^{\phi \left(u\right)}.$

To minimize the upper bound let's express $\phi \left(u\right)$ in a Taylor's series with remainder :

$\phi \left(u\right)=\phi \left(0\right)+u{\phi }^{\text{'}}\left(0\right)+\frac{{u}^{2}}{2}{\phi }^{\text{'}\text{'}}\left(v\right)\phantom{\rule{4.pt}{0ex}}\text{for}\phantom{\rule{4.pt}{0ex}}\text{some}\phantom{\rule{4.pt}{0ex}}v\in \left[0,u\right]$
$\begin{array}{ccc}\hfill {\phi }^{\text{'}}\left(u\right)& =& -\theta +\frac{\theta {e}^{u}}{1-\theta +\theta {e}^{u}}⇒{\phi }^{\text{'}}\left(u\right)=0\hfill \\ \hfill {\phi }^{\text{'}\text{'}}\left(u\right)& =& \frac{\theta {e}^{u}}{1-\theta +\theta {e}^{u}}-\frac{{\left(\theta {e}^{u}\right)}^{2}}{{\left(1-\theta +\theta {e}^{u}\right)}^{2}}\hfill \\ & =& \frac{\theta {e}^{u}}{1-\theta +\theta {e}^{u}}\left(1-\frac{\theta {e}^{u}}{1-\theta +\theta {e}^{u}}\right)\hfill \\ & =& \rho \left(1-\rho \right)\hfill \end{array}.$

Now, ${\phi }^{\text{'}\text{'}}\left(u\right)$ is maximized by

$\rho =\frac{\theta {e}^{u}}{1-\theta +\theta {e}^{u}}=\frac{1}{2}⇒{\phi }^{\text{'}\text{'}}\left(u\right)\le \frac{1}{4}.$

So,

$\phi \left(u\right)\le \frac{{u}^{2}}{8}=\frac{{s}^{2}{\left(b-a\right)}^{2}}{8}$
$⇒E\left[{e}^{sZ}\right]\le {e}^{\frac{{s}^{2}{\left(b-a\right)}^{2}}{8}}.$

Now, we can apply this upper bound to derive Hoeffding's inequality.

$\begin{array}{ccc}\hfill P\left({S}_{n}-E\left[{S}_{n}\right]\ge t\right)& \le & {e}^{-st}\prod _{i=1}^{n}E\left[{e}^{s\left({L}_{i}-E\left[{L}_{i}\right]\right)}\right]\hfill \\ & \le & {e}^{-st}\prod _{i=1}^{n}{e}^{\frac{{s}^{2}{\left({b}_{i}-{a}_{i}\right)}^{2}}{8}}\hfill \\ & =& {e}^{-st}{e}^{{s}^{2}{\sum }_{i=1}^{n}\frac{{\left({b}_{i}-{a}_{i}\right)}^{2}}{8}}\hfill \\ & =& {e}^{\frac{-2{t}^{2}}{{\sum }_{i=1}^{n}{\left({b}_{i}-{a}_{i}\right)}^{2}}}\hfill \\ & & \text{by}\phantom{\rule{4.pt}{0ex}}\text{choosing}\phantom{\rule{4.pt}{0ex}}\phantom{\rule{4.pt}{0ex}}s=\frac{4t}{{\sum }_{i=1}^{n}{\left({b}_{i}-{a}_{i}\right)}^{2}}\hfill \end{array}$

Similarly, $P\left(E\left[{S}_{n}\right]-{S}_{n}\ge t\right)\le {e}^{\frac{-2{t}^{2}}{{\sum }_{i=1}^{n}{\left({b}_{i}-{a}_{i}\right)}^{2}}}$ . This completes the proof of the Hoeffding's theorem.

## Application

Let ${Z}_{i}={1}_{f\left({X}_{i}\right)\ne {Y}_{i}}-R\left(f\right),$ as in the classification problem. Then for a fixed f, it follows fromHoeffding's inequality (i.e., Chernoff's bound in this special case) that

$\begin{array}{ccc}\hfill P\left(|\stackrel{^}{{R}_{n}}\left(f\right)-R\left(f\right)|\ge ϵ\right)& =& P\left(\frac{1}{n},|{S}_{n}-E\left[{S}_{n}\right]|,\ge ,ϵ\right)\hfill \\ & =& P\left(|{S}_{n}-E\left[{S}_{n}\right]|\ge nϵ\right)\hfill \\ & \le & 2{e}^{-\frac{2{\left(nϵ\right)}^{2}}{n}}\hfill \\ & =& 2{e}^{-2n{ϵ}^{2}}\hfill \end{array}.$

Now, we want a bound like this to hold uniformly for all $f\in \mathcal{F}$ . Assume that $\mathcal{F}$ is a finite collection of models and let $|\mathcal{F}|$ denote its cardinality. We would like to bound the probability that ${max}_{f\in \mathcal{F}}|\stackrel{^}{{R}_{n}}\left(f\right)-R\left(f\right)|\ge ϵ$ . Note that the event

$\left\{\underset{f\in \mathcal{F}}{max},|\stackrel{^}{{R}_{n}}\left(f\right)-R\left(f\right)|,\ge ,ϵ\right\}\phantom{\rule{4pt}{0ex}}\equiv \phantom{\rule{4pt}{0ex}}\left\{\bigcup _{f\in \mathcal{F}},|\stackrel{^}{{R}_{n}}\left(f\right)-R\left(f\right)|,\ge ,ϵ\right\}.$

Therefore

$\begin{array}{ccc}\hfill P\left(\underset{f\in \mathcal{F}}{max},|\stackrel{^}{{R}_{n}}\left(f\right)-R\left(f\right)|,\ge ,ϵ\right)& =& P\left(\bigcup _{f\in \mathcal{F}},|\stackrel{^}{{R}_{n}}\left(f\right)-R\left(f\right)|,\ge ,ϵ\right)\hfill \\ & \le & \sum _{f\in F}P\left(|\stackrel{^}{{R}_{n}}\left(f\right)-R\left(f\right)|\ge ϵ\right),\phantom{\rule{4.pt}{0ex}}\text{the}\phantom{\rule{4.pt}{0ex}}\text{}\mathit{\text{union}}\phantom{\rule{4.pt}{0ex}}\mathit{\text{of}}\phantom{\rule{4.pt}{0ex}}\mathit{\text{events}}\text{''}\phantom{\rule{4.pt}{0ex}}\text{bound}\hfill \\ & \le & 2|F|{e}^{-2n{ϵ}^{2}},\phantom{\rule{4.pt}{0ex}}\text{by}\phantom{\rule{4.pt}{0ex}}\text{Hoeffding's}\phantom{\rule{4.pt}{0ex}}\text{inequality.}\hfill \end{array}$

Thus, we have shown that with probability at least $1-2|F|{e}^{-2n{ϵ}^{2}}$ , $\forall f\in \mathcal{F}$

$|\stackrel{^}{{R}_{n}}\left(f\right)-R\left(f\right)|<ϵ.$

And accordingly, we can be reasonably confident in selecting $f$ from $\mathcal{F}$ based on the empirical risk function ${\stackrel{^}{R}}_{n}$ .

#### Questions & Answers

can someone help me with some logarithmic and exponential equations.
sure. what is your question?
20/(×-6^2)
Salomon
okay, so you have 6 raised to the power of 2. what is that part of your answer
I don't understand what the A with approx sign and the boxed x mean
it think it's written 20/(X-6)^2 so it's 20 divided by X-6 squared
Salomon
I'm not sure why it wrote it the other way
Salomon
I got X =-6
Salomon
ok. so take the square root of both sides, now you have plus or minus the square root of 20= x-6
oops. ignore that.
so you not have an equal sign anywhere in the original equation?
Commplementary angles
hello
Sherica
im all ears I need to learn
Sherica
right! what he said ⤴⤴⤴
Tamia
what is a good calculator for all algebra; would a Casio fx 260 work with all algebra equations? please name the cheapest, thanks.
a perfect square v²+2v+_
kkk nice
algebra 2 Inequalities:If equation 2 = 0 it is an open set?
or infinite solutions?
Kim
The answer is neither. The function, 2 = 0 cannot exist. Hence, the function is undefined.
Al
y=10×
if |A| not equal to 0 and order of A is n prove that adj (adj A = |A|
rolling four fair dice and getting an even number an all four dice
Kristine 2*2*2=8
Differences Between Laspeyres and Paasche Indices
No. 7x -4y is simplified from 4x + (3y + 3x) -7y
is it 3×y ?
J, combine like terms 7x-4y
im not good at math so would this help me
yes
Asali
I'm not good at math so would you help me
Samantha
what is the problem that i will help you to self with?
Asali
how do you translate this in Algebraic Expressions
Need to simplify the expresin. 3/7 (x+y)-1/7 (x-1)=
. After 3 months on a diet, Lisa had lost 12% of her original weight. She lost 21 pounds. What was Lisa's original weight?
what's the easiest and fastest way to the synthesize AgNP?
China
Cied
types of nano material
I start with an easy one. carbon nanotubes woven into a long filament like a string
Porter
many many of nanotubes
Porter
what is the k.e before it land
Yasmin
what is the function of carbon nanotubes?
Cesar
what is nanomaterials​ and their applications of sensors.
what is nano technology
what is system testing?
preparation of nanomaterial
Yes, Nanotechnology has a very fast field of applications and their is always something new to do with it...
what is system testing
what is the application of nanotechnology?
Stotaw
In this morden time nanotechnology used in many field . 1-Electronics-manufacturad IC ,RAM,MRAM,solar panel etc 2-Helth and Medical-Nanomedicine,Drug Dilivery for cancer treatment etc 3- Atomobile -MEMS, Coating on car etc. and may other field for details you can check at Google
Azam
anybody can imagine what will be happen after 100 years from now in nano tech world
Prasenjit
after 100 year this will be not nanotechnology maybe this technology name will be change . maybe aftet 100 year . we work on electron lable practically about its properties and behaviour by the different instruments
Azam
name doesn't matter , whatever it will be change... I'm taking about effect on circumstances of the microscopic world
Prasenjit
how hard could it be to apply nanotechnology against viral infections such HIV or Ebola?
Damian
silver nanoparticles could handle the job?
Damian
not now but maybe in future only AgNP maybe any other nanomaterials
Azam
can nanotechnology change the direction of the face of the world
At high concentrations (>0.01 M), the relation between absorptivity coefficient and absorbance is no longer linear. This is due to the electrostatic interactions between the quantum dots in close proximity. If the concentration of the solution is high, another effect that is seen is the scattering of light from the large number of quantum dots. This assumption only works at low concentrations of the analyte. Presence of stray light.
the Beer law works very well for dilute solutions but fails for very high concentrations. why?
how did you get the value of 2000N.What calculations are needed to arrive at it
Privacy Information Security Software Version 1.1a
Good
Got questions? Join the online conversation and get instant answers!