stbp_posterior_simple | R Documentation |
This function calculates a posterior probability for hypotheses about population
densities, of the form H:\mu = 0
, given the data at a single
iteration. This function is to be used in a sequential framework, and called
on the sequential test stbp_simple
.
stbp_posterior_simple(
data,
density_func,
overdispersion = NA,
prior,
upper_bnd = Inf
)
data |
For count data, a numeric vector with for a single sampling bout (NAs allowed). For binomial data, a matrix with observations in col 1 and samples in col 2 (NAs not allowed). |
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 |
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.
A single probability
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>
# Counts collected in a single sampling bout
counts <- c(0, 0, 0)
# Calculate posterior probability from a naive 0.5 prior for H:mu=0
# (a species being absent in an area) with a poisson kernel.
stbp_posterior_simple(data = counts,
density_func = "poisson",
prior = 0.5,
upper_bnd = Inf) # returns 0.75
## End (Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.