API

pydiver

pydiver.counts_from_sample(sample)[source]

Calculate a list of counts of unique elements

pydiver.pc(n)[source]

Estimate Simpson’s index from sample counts.

n: array-like

sampled abundances n_i = number of counts of the ith species

pydiver.pc_population(p)[source]

Calculate Simpson’s index from population frequencies.

p: array-like

population species frequencies

pydiver.pc_sample(sample, **kwargs)[source]

Calculate Simpson’s index from a sample.

sample: array-like

list of sampled individuals

pydiver.varpc(n, method='unbiased', bootnum=200, poisson_bound=False)[source]

Estimate variance of Simpson’s index from sample counts.

n: array-like

sampled abundances n_i = number of counts of the ith species

method: string

one of ‘unbiased’, ‘plugin’, ‘grundmann’, ‘chao’, ‘shrinkage’, ‘poisson’

bootnum: int

number of bootstrap samples (if method=’chao’)

poisson_boundboolean

use Poisson variance as bound (if method=’unbiased’)

pydiver.varpc_population(p, N)[source]

Calculate variance of Simpson’s index from population frequencies.

p: array-like

population species frequencies

N: int

sample size

pydiver.varpc_sample(sample, **kwargs)[source]

Estimate variance of Simpson’s index from a sample.

sample: array-like

list of sampled individuals

method: string

one of ‘unbiased’, ‘plugin’, ‘grundmann’, ‘chao’

bootnum: int

number of bootstrap samples (if method=’chao’)