Skip to content

Fit models to data from unmarked animals using Stan. Uses a similar interface to the R package 'unmarked', while providing the advantages of Bayesian inference and allowing estimation of random effects.

License

Notifications You must be signed in to change notification settings

biodiverse/ubms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a31630e · Feb 26, 2025
Feb 12, 2025
Feb 26, 2025
Sep 10, 2023
Feb 26, 2025
Oct 23, 2020
Sep 15, 2024
Feb 26, 2025
Sep 30, 2024
Mar 31, 2022
May 12, 2020
May 20, 2021
Sep 30, 2024
Oct 15, 2020
Sep 15, 2024
Sep 15, 2024
Sep 30, 2024
Sep 30, 2024
Jan 18, 2024
Apr 7, 2020
Apr 7, 2020
Nov 29, 2021

Repository files navigation

ubms: Unmarked Bayesian Models with Stan

R build status CRAN status

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:

  1. Obtain posterior distributions of parameters and derived parameters
  2. Include random effects in parameter formulas (same syntax as lme4)
  3. Assess model fit using WAIC and LOO via the loo package

Disadvantages compared to unmarked:

  1. MCMC is slower than maximum likelihood
  2. Not all model types are supported
  3. Potential for convergence issues

Installation

ubms is on CRAN:

install.packages("ubms")

Alternatively, the latest development version can be installed from Github:

# install.packages("devtools")
devtools::install_github("biodiverse/ubms")

Package Overview

A detailed vignette for the package is available here.

About

Fit models to data from unmarked animals using Stan. Uses a similar interface to the R package 'unmarked', while providing the advantages of Bayesian inference and allowing estimation of random effects.

Topics

Resources

License

Citation

Stars

Watchers

Forks