# Shannon

Example Calculations

*.shannon

These files give the classic Shannon-Weaver Index of diversity.

$H_{Shannon} = - \sum_{i=1}^{S_{obs}} \frac{S_i}{N} ln \frac{S_i}{N}$

For the Amazonian dataset the Shannon Index is 4.35.

To obtain the 95% confidence interval we assume that the variance is normally distributed and can be calculated as

$var\left ( H_{Shannon} \right ) = \frac {\sum_{i=1}^{S_{obs}} \frac{S_i}{N} \left ( ln \frac{S_i}{N} \right )^2 - H_{Shannon}^{2}}{N} + \frac{S_{obs} - 1}{2N^{2}}$

The variance is 0.0020. This gives a lower and upper bound to the 95% confidence interval of 4.26 and 4.44.