Learn R Programming

BTSPAS

Bayesian Time Stratified Petersen Analysis System

Versions and installation

  • Github To install the latest development version from Github, install the newest version of the devtools package; then run
devtools::install_github("cschwarz-stat-sfu-ca/BTSPAS", dependencies = TRUE,
                        build_vignettes = TRUE)

Features

Provides advanced Bayesian methods to estimate abundance and run-timing from temporally-stratified Petersen mark-recapture experiments as described in Bonner and Schwarz(2011). Methods include hierarchical modelling of the capture probabilities and spline smoothing of the daily run size. This version uses JAGS to sample from the posterior distribution.

This is a more specific application of a stratified Petersen (Darroch, 1961; Plante et al 1988; Schwarz and Taylor, 1998) where, for example, fish are tagged a a fish wheel over a series of weeks, migrate, and then are recaptured. The stratification is temporal rather than geographical. This temporal stratification enable estimation of the run profile and various other parameters of interest such as abundance.

Copy Link

Version

Install

install.packages('BTSPAS')

Monthly Downloads

776

Version

2024.5.9

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Carl Schwarz

Last Published

May 10th, 2024

Functions in BTSPAS (2024.5.9)

plot_posterior

Create posterior plot of a parameter with credible interval limits shown as vertical lines
plot_acf

Create an acf plot of a parameter
plot_trace

Creates trace plots of specified parameters showing the multiple chains and the value of Rhat
SimplePetersen

Simple Petersen Estimator and test if pooling can be done
TimeStratPetersenNonDiagErrorNP_fit

Wrapper (*_fit) to fit the Time Stratified Petersen Estimator with NON Diagonal Entries function and a non-parametric travel time estimator..
RunTime

Compute percentiles of the run timing distribution.
TimeStratPetersenDiagError_fit

Wrapper (*_fit) to call the Time Stratified Petersen Estimator with Diagonal Entries function.
PredictivePosteriorPlot.TSPDE

Generate Predictive Posterior Plots (Bayesian p-values) for number of models.
TimeStratPetersenNonDiagErrorNPMarkAvail_fit

Wrapper (*_fit) to call the function to fit a Time Stratified Petersen Estimator with NON Diagonal Entries with an non-parametric travel time and fall back
TimeStratPetersenNonDiagError_fit

Wrapper (*_fit) to fit the Time Stratified Petersen Estimator with NON Diagonal Entries function.
TimeToTargetRunSize

Computes and plots posterior distribution of time to get target run size. For example, the time to reach a cumulative run of 10,000 fish.
TimeStratPetersenDiagErrorWHChinook2_fit

Wrapper (*_fit) to fit the Time Stratified Petersen Estimator with Diagonal Entries and separating Wild from Hatchery Chinook function.
logit

Logit and anti-logit function.
.onAttach

Message to display when package is loaded
TimeStratPetersenDiagErrorWHSteel_fit

Wrapper (*_fit) and function to call the Time Stratified Petersen Estimator with Diagonal Entries and separating Wild from Hatchery Steelhead function.