Consider a measure $\mu$ on a finite set, and let $x\_1, \ldots, x\_n$ be i.i.d samples from $\mu$. Then the expression $S\_n = -\frac{1}{n} \sum\_{i=1}^n \log \mu(x\_i)$ converges by a.s. to the entropy $H(\mu)$. 


What concentration inequalities exist for finite $n$? In other words, what upper bounds are known for the expression $P(|S\_n - H(\mu)|>t)$? 


Of course, we can get some upper bounds using, for instance, Bernstein's inequality for bounded variables, with bound depending on the size of the smallest atom of $\mu$. However, using the sup norm bound seems very rough in this case, since small atoms inflate the norm but also have small contributions to the mean. On the other hand, using more general versions of Bernstein's inequality with moment bounds does not seem natural. ($\sum\_{i \in X} \mu(i) \log^k \mu(i)$ does not seem like a natural quantity). 


Since this is a classical situation, there probably exist sharper inequalities than sup norm, using some natural quantities. What are they? 



concentration inequality for entropy from sample
Actually, Bernstein's inequality does not really require boundedness of the i.i.d. random summands; a finite exponential moment of the absolute value of a random summand will suffice. However, here we can just use Markov's inequality. 


Let $X,X\_1,\dots,X\_n$ be independent identically distributed random variables (i.i.d. r.v.'s) such that $P(X=z)=\mu(z)\in(0,1)$ for all $z$ in a finite set $Z$, with $\sum\_z\mu(z)=1$. Let $Y:=-\ln\mu(X)$, $Y\_i:=-\ln\mu(X\_i)$, and $S\_n:=\frac1n\,\sum\_1^n Y\_i$. Then 
$$ES\_n=EY=-\sum\_z\mu(z)\ln\mu(z)=:H(\mu)>0 
$$ 
and 
$$Ee^{hY}=\sum\_z\mu(z)^{1-h},\quad Ee^{hS\_n}=(Ee^{hY})^n \tag{1}
$$
for all real $h$. 
To avoid trivialities, assume that $\max Y:=-\min\_z\ln\mu(z)>-\max\_z\ln\mu(z)=:\min Y$. 
Then 
$$\min Y<EY=H(\mu)<\max Y.$$ 


Take now any real $t$ such that $H(\mu)=EY\le t<\max Y$. For all real $h\ge0$, by Markov's inequality, 
$$P(S\_n\ge t)\le\exp\{-nht+\ln Ee^{nhS\_n}\}=\exp\{-nht+n\ln Ee^{hY}\}. \tag{2}
$$
The derivative of the exponent $-nht+n\ln Ee^{hY}$ in $h$ is $-nt+n\frac{EYe^{hY}}{Ee^{hY}}$, which strictly and continuously increases from $-nt+nEY\le 0$ to $-nt+n\max Y\ge0$ as $h$ increases from $0$ to $\infty$, and so, the upper bound $\exp\{-nht+n\ln Ee^{hY}\}$ on the right-tail probability $P(S\_n\ge t)$ is minimized when $h=h\_{t,+}=h\_{t,\mu,+}$ is the only nonnegative root of the equation 
$$m(h):=m\_\mu(h):=\frac{EYe^{hY}}{Ee^{hY}}=t. \tag{3} 
$$


Similarly, for any real $t$ such that $H(\mu)=EY\ge t>\min Y$, the best upper exponential bound on the left-tail probability $P(S\_n\le t)$ is $\exp\{-nht+n\ln Ee^{hY/n}\}$, where now $h=h\_{t,-}=h\_{t,\mu,-}$ is the only non-positive root of the equation $(2)$. 


Thus, 
$$P(S\_n\ge t)\le e^{-na\_+(t)},\quad\text{where $a\_+(t):=h\_{t,+}t-\ln Ee^{h\_{t,+}Y}>0$} \tag{4}
$$
if $H(\mu)=EY<t<\max Y$, 
$$P(S\_n\le t)\le e^{-na\_-(t)},\quad\text{where $a\_-(t):=h\_{t,-}t-\ln Ee^{h\_{t,-}Y}>0$} \tag{5}
$$
if $H(\mu)=EY>t>\min Y$
So, these bounds exponentially decrease in $n$ if $t$ is fixed. 
By formulas (3.7) and (3.8) in **[[Chernoff](https://projecteuclid.org/euclid.aoms/1177729330)]**, bounds $(4)$ and $(5)$ cannot be improved by replacing $a\_\pm(t)$ by greater values. 


In view of $(1)$, equation $(3)$ can be rewritten as 
$$\sum\_z(t+\ln\mu(z))\mu(z)^{1-h}=0, \tag{6}
$$
and this equation can be easily solved for $h$ numerically if the set $Z$ is not too large. 


All this is of course well known, even in the general case of i.i.d. random summands with finite exponential moment of the absolute value. Basically, in this particular situation I have just added the first equality in $(1)$ and rewrote $(3)$ as $(6)$. 


