stbp_simple | R Documentation |
Runs a Sequential test of Bayesian Posterior Probabilities for hypotheses
about species absence of the form H:\mu = 0
. Data is treated in a
sequential framework.
stbp_simple(
data,
density_func,
overdispersion = NA,
prior = 0.5,
upper_bnd = Inf,
lower_criterion,
upper_criterion
)
data |
For count data, either a vector (for purely sequential designs) o a matrix (group sequential designs) with sequential count data, with sampling bouts collected over time in columns and samples within bouts in rows. NAs are allowed in case sample size within bouts is unbalanced. For binomial data, a list of matrices with integer non-negative values of observations in col 1 and number of samples in col 2, so that each matrix within the list corresponds to a sampling bout. NAs are not allowed for binomial data. |
density_func |
Kernel probability density function for the data. See details. |
overdispersion |
A character string (if a function) or a number
specifying the overdispersion parameter. Only required when using
|
prior |
Single number with initial prior. Must be in the interval
|
upper_bnd |
Single number indicating the greatest possible value for |
lower_criterion |
Criterion to decide against the tested hypothesis. This is the lowest credibility to the hypothesis to stop sampling and decide against. |
upper_criterion |
Criterion to decide in favor of the tested hypothesis. This is the greatest credibility to the hypothesis to stop sampling and decide in favor. |
The density_func
argument should be specified as character string.
Acceptable options are "poisson"
, "negative binomial"
,
"binomial"
and "beta-binomial"
. The overdispersion
parameter for "negative binomial"
and "beta-binomial"
can be
either a constant or a function of the mean.
If a function, it should be specified as a character string with the name of
an existing function. For options of empirical functions to describe
overdispersion as a function of the mean see Binns et al. (2000). The most
common approach for the negative binomial family is Taylor's Power Law, which
describes the variance as a function of the mean with two parameters, a
and b
. Overdispersion, k
, can then be specified as:
k = \frac{\mu^2}{a \mu^b - \mu}
An object of class "STBP"
.
Binns, M.R., Nyrop, J.P. & Werf, W.v.d. (2000) Sampling and monitoring in crop protection: the theoretical basis for developing practical decision guides. CABI Pub., Wallingford, Oxon, UK; New York, N.Y.
Rincon, D.F., McCabe, I. & Crowder, D.W. (2025) Sequential testing of complementary hypotheses about population density. Methods in Ecology and Evolution. <https://doi.org/10.1111/2041-210X.70053>
# Testing the absence of a species in a given area from a sequential random
# sampling of 3 bouts made of 10 samples (counts) each (all absences). Upper
# criterion set to 0.9999
counts10 <- matrix(rep(0, 30), 10, 3)
test1G <- stbp_simple(data = counts10,
density_func = "poisson",
prior = 0.5,
upper_bnd = Inf,
lower_criterion = 0,
upper_criterion = 0.9999)
test1G
# returns a recommendation of "keep sampling" due to insufficient evidence.
# Testing the same hypothesis with the same upper criterion but from a
# sequential random sampling of 3 bouts made of 30 samples (counts) each
# (all absences).
counts30 <- matrix(rep(0, 90), 30, 3)
test2G <- stbp_simple(data = counts30,
density_func= "poisson",
prior = 0.5,
upper_bnd = Inf,
lower_criterion = 0,
upper_criterion = 0.9999)
test2G
# returns a recommendation of "accept H" of the species being absent from
# that area.
## End (Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.