Shannon's Diversity Re-sampler

Share:

Description

This function is a wrapper for sample and can be used to determine the expected value of a diversity index under a specified sampling intensity. A Monte-Carlo procedure is used to re-sample a given observation with replacement at each user-specified sampling intensity. The resampling can take place through one of two schemes. First, where the observed frequencies of species are assumed to represent the true underlying values, and second, where a user-specified vector of probabilities is used to control the resampling. The function calculates a diversity index over each simulated sample and summarises these for each specified level of sampling intensity via their mean.

Arguments

The base of the logarithm used to calculate Shannon's index (DEFAULT = e).

corr

Correction factor for small sample sizes.

p

A vector or matrix of weights corresponding to x, which can be used to simulate scenarios where forces other than sampling impact diversity.

method

The diversity metric: "Shannon" or "Gene diversity"

Details

The Monte-Carlo procedure draws random individuals based on the relative abundances of the species in a given observation. This process is repeated for the number of specified iterations at each designated sample level. For each iteration, the diversity index is calculated, and the mean is taken from all the indices produced in each iteration.

Value

A matrix of diversity indices for each observation (rows) at each sampling level (columns).