Bt_prob_abu: Generate "augmented" sample for bootstrapping

View source: R/fromSpadeR.R

Bt_prob_abuR Documentation

Generate "augmented" sample for bootstrapping

Description

Estimates true species frequencies (including unobserved species). The estimated species frequencies are bootstrapped to generate CI for diversity estimates following the method of Chao and Jost 2015 MEE. We modified the source code from SpadeR so that parameter names matched analogous use elsewhere in the MeanRarity package. This function is copied directly fromSpadeR:::Chat.Ind() from the R package SpadeR 0.1.1 by Anne Chao, K. H. Ma, T. C. Hsieh and Chun-Huo Chiu.

Usage

Bt_prob_abu(ab)

Arguments

ab

A numeric vector of species abundances or relative abundances.

Value

numeric vector of Estimated species frequencies

References

\insertRef

Chao2015MeanRarity

Examples


# a sample
ab <- c(1, 1, 1, 2, 2, 2, 3, 4, 5, 7, 9, 12, 13, 21, 25, 50)

# sample frequencies
freq <- (ab/sum(ab))
freq[order(freq, decreasing = TRUE)]

#estimated true frequencies
etf <- Bt_prob_abu(ab)
etf[order(etf , decreasing = TRUE)]
# adjustment evident from 4th species on, 2 new rare species added

sum(etf) #rel. abundances still sum to 1


mikeroswell/MeanRarity documentation built on May 5, 2024, 4:50 p.m.