ubms
is an R
package for fitting Bayesian hierarchical models of
animal occurrence and abundance. The package has a formula-based
interface compatible with
unmarked,
but the model is fit using MCMC with Stan
instead of using maximum likelihood. Currently there are Stan versions
of unmarked functions occu
, occuRN
, colext
, occuTTD
, pcount
,
distsamp
, and multinomPois
. These functions follow the stan_
prefix naming format established by
rstanarm.
For example, the Stan version of the unmarked
function occu
is
stan_occu
.
Advantages compared to unmarked
:
- Obtain posterior distributions of parameters and derived parameters
- Include random effects in parameter formulas (same syntax as
lme4
) - Assess model fit using WAIC and LOO via the loo package
Disadvantages compared to unmarked
:
- MCMC is slower than maximum likelihood
- Not all model types are supported
- Potential for convergence issues
ubms
is on
CRAN:
install.packages("ubms")
Alternatively, the latest development version can be installed from Github:
# install.packages("devtools")
devtools::install_github("hmecology/ubms")
A detailed vignette for the package is available here.