Calculates the Generalized Simpson's entropy of order *r* of a probability or abundance vector, and its effective number of species.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ```
GenSimpson(NorP, r = 1, CheckArguments = TRUE, Ps = NULL, Ns = NULL)
bcGenSimpson(Ns, r = 1, CheckArguments = TRUE)
## S3 method for class 'ProbaVector'
GenSimpson(NorP, r = 1, CheckArguments = TRUE,
Ps = NULL, Ns = NULL)
## S3 method for class 'AbdVector'
GenSimpson(NorP, r = 1, CheckArguments = TRUE,
Ps = NULL, Ns = NULL)
## S3 method for class 'integer'
GenSimpson(NorP, r = 1, CheckArguments = TRUE,
Ps = NULL, Ns = NULL)
## S3 method for class 'numeric'
GenSimpson(NorP, r = 1, CheckArguments = TRUE,
Ps = NULL, Ns = NULL)
GenSimpsonD(NorP, r = 1, CheckArguments = TRUE, Ps = NULL, Ns = NULL)
bcGenSimpsonD(Ns, r = 1, CheckArguments = TRUE)
## S3 method for class 'ProbaVector'
GenSimpsonD(NorP, r = 1, CheckArguments = TRUE,
Ps = NULL, Ns = NULL)
## S3 method for class 'AbdVector'
GenSimpsonD(NorP, r = 1, CheckArguments = TRUE,
Ps = NULL, Ns = NULL)
## S3 method for class 'integer'
GenSimpsonD(NorP, r = 1, CheckArguments = TRUE,
Ps = NULL, Ns = NULL)
## S3 method for class 'numeric'
GenSimpsonD(NorP, r = 1, CheckArguments = TRUE,
Ps = NULL, Ns = NULL)
``` |

`Ps` |
A probability vector, summing to 1. |

`Ns` |
A numeric vector containing species abundances. |

`NorP` |
A numeric vector, an integer vector, an abundance vector ( |

`r` |
A number: the order of diversity. Default is 1 for Simpson's diversity. |

`CheckArguments` |
Logical; if |

The Generalized Simpson's Entropy (Zhang and Zhou, 2010) of order *r* is, in the species accumulation curve, the probability for the individual sampled in rank *r+1* to belong to a new species. It is a measure of diversity so long as *r* is lower than the number of species (Grabchak *et al.*, 2016).

Bias correction requires the number of individuals. Use `bcGenSimpson`

. It is limited to orders *r* less than or equal to the number of individuals in the community.

The effective number of species `GenSimpsonD`

(explicit diversity) has been derived by Grabchak *et al.* (2016).

The functions are designed to be used as simply as possible. `GenSimpson`

is a generic method. If its first argument is an abundance vector, an integer vector or a numeric vector which does not sum to 1, the bias corrected function `bcGenSimpson`

is called. Explicit calls to `bcGenSimpson`

(with bias correction) or to `GenSimpson.ProbaVector`

(without correction) are possible to avoid ambiguity. The `.integer`

and `.numeric`

methods accept `Ps`

or `Ns`

arguments instead of `NorP`

for backward compatibility.

A named number equal to the calculated index or diversity. The name is either "Biased" or "Unbiased", depending on the estimator used.

The unbiased estimator is calculated by the `GenSimp.z`

function of the `EntropyEstimation`

package.

Eric Marcon <Eric.Marcon@ecofog.gf>

Grabchak M., Marcon E., Lang G. & Zhang Z. (2016) The Generalized Simpson?s Entropy is a Measure of Biodiversity. *Methods in Ecology and Evolution* submitted.

Zhang Z. & Zhou J. (2010) Re-parameterization of multinomial distributions and diversity indices. *Journal of Statistical Planning and Inference* 140(7): 1731?1738.

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
# Load Paracou data (number of trees per species in two 1-ha plot of a tropical forest)
data(Paracou618)
# Ns is the total number of trees per species
Ns <- as.AbdVector(Paracou618.MC$Ns)
# Species probabilities
Ps <- as.ProbaVector(Paracou618.MC$Ns)
# Whittaker plot
plot(Ns)
# Calculate GenSimpson entropy of order 1, equal to Simpson's index of diversity
GenSimpson(Ps, 1)
# Calculate an unbiased estimator of GenSimpson entropy of order 100
GenSimpson(Ns, 100)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.