ds.rSAC.bootstrap
predicts the expected number of species
represented at least
ds.rSAC.bootstrap(n, r=1, mt=20, times=30, conf=0.95)
A two-column matrix.
The first column is the frequency
A positive integer. Default is 1.
An positive integer constraining possible rational function approximations. Default is 20.
The number of bootstrap samples. Default is 30.
The confidence level. Default is 0.95
The estimator for the number of species represented at least
The standard error for the estimator. The input is a vector of sampling
efforts
The lower bound of the confidence interval.The input is a vector of sampling
efforts
The upper bound of the confidence interval.The input is a vector of sampling
efforts
This is the bootstrap version of ds.rSAC
. The bootstrap
sample is generated by randomly sampling the initial sample with replacement.
For each bootstrap sample, we construct an estimator. The median of
estimates is used as the prediction for the number of species
represented at least
The confidence interval is constructed based on a lognormal distribution.
Efron, B., & Tibshirani, R. J. (1994). An introduction to the bootstrap. CRC press.
Deng, C., Daley, T., Calabrese, P., Ren, J., & Smith, A.D. (2016). Estimating the number of species to attain sufficient representation in a random sample. arXiv preprint arXiv:1607.02804v3.
# NOT RUN {
## load library
# library(preseqR)
## import data
# data(FisherButterfly)
## construct the estimator for SAC
# ds1 <- ds.rSAC.bootstrap(FisherButterfly, r=1)
## The number of species represented at least once in a sample,
## when the sample size is 10 or 20 times of the initial sample
# ds1$f(c(10, 20))
## The standard error of the estiamtes
# ds1$se(c(10, 20))
## The confidence interval of the estimates
# lb <- ds1$lb(c(10, 20))
# ub <- ds1$ub(c(10, 20))
# matrix(c(lb, ub), byrow=FALSE, ncol=2)
## construct the estimator for SAC
# ds2 <- ds.rSAC.bootstrap(FisherButterfly, r=2)
## The number of species represented at least twice in a sample,
## when the sample size is 50 or 100 times of the initial sample
# ds2$f(c(50, 100))
## The standard error of the estiamtes
# ds2$se(c(50, 100))
## The confidence interval of the estimates
# lb <- ds2$lb(c(50, 100))
# ub <- ds2$ub(c(50, 100))
# matrix(c(lb, ub), byrow=FALSE, ncol=2)
# }
Run the code above in your browser using DataLab