Package: BTSPAS 2026.3.1

BTSPAS: Bayesian Time-Stratified Population Analysis

Provides advanced Bayesian methods to estimate abundance and run-timing from temporally-stratified Petersen mark-recapture experiments. Methods include hierarchical modelling of the capture probabilities and spline smoothing of the daily run size. Theory described in Bonner and Schwarz (2011) <doi:10.1111/j.1541-0420.2011.01599.x>.

Authors:Carl J Schwarz [aut, cre], Simon J Bonner [aut]

BTSPAS_2026.3.1.tar.gz
BTSPAS_2026.3.1.zip(r-4.7-any)BTSPAS_2026.3.1.zip(r-4.6-any)BTSPAS_2026.3.1.zip(r-4.5-any)
BTSPAS_2026.3.1.tgz(r-4.6-any)BTSPAS_2026.3.1.tgz(r-4.5-any)
BTSPAS_2026.3.1.tar.gz(r-4.7-any)BTSPAS_2026.3.1.tar.gz(r-4.6-any)
BTSPAS_2026.3.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
BTSPAS/json (API)

# Install 'BTSPAS' in R:
install.packages('BTSPAS', repos = c('https://cschwarz-stat-sfu-ca.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/cschwarz-stat-sfu-ca/btspas/issues

Uses libs:
  • jags– Just Another Gibbs Sampler for Bayesian MCMC
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

jagscpp

4.95 score 1 stars 30 scripts 574 downloads 13 exports 44 dependencies

Last updated from:db6eaa3aa9. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK159
source / vignettesOK210
linux-releaseOK164
macos-releaseOK173
macos-oldrelOK175
windows-develOK99
windows-releaseOK107
windows-oldrelOK101
wasm-releaseOK123

Exports:expitlogitRunTimeSimplePetersenTestIfPoolTimeStratPetersenDiagError_fitTimeStratPetersenDiagErrorWHChinook_fitTimeStratPetersenDiagErrorWHChinook2_fitTimeStratPetersenDiagErrorWHSteel_fitTimeStratPetersenNonDiagError_fitTimeStratPetersenNonDiagErrorNP_fitTimeStratPetersenNonDiagErrorNPMarkAvail_fitTimeToTargetRunSize

Dependencies:abindactuarbackportsbase64encbootcheckmateclicodacpp11data.tableexpintfarverggforceggplot2gluegridExtragtableisobandjsonlitelabelinglatticelifecyclemagrittrMASSplyrpolyclipR2jagsR2WinBUGSR6RColorBrewerRcppreshape2rjagsrlangS7scalesstringistringrsystemfontstidyselecttweenrvctrsviridisLitewithr

06 Interpolating run earlier and later
Interpolating run early and late | 1 Introduction | 1.1 Fit with the current data. | 1.2 Forcing the run curve to zero.

Last update: 2020-08-09
Started: 2020-08-09

01 Diagonal model
Diagonal Case | 1 Location of vignette source and code. | 2 Introduction | 3 Experimental Protocol | 4 Example of basic BTSPAS fit. | 4.1 Reading in the data | 4.2 Preliminary screening of the data | 4.3 Fitting the basic BTSPAS diagonal model | 4.4 The output from the basic fit | 5 Fixing p’s | 5.1 Reading in the data | 5.2 Fitting the BTSPAS diagonal model and fixing p.  | 5.3 The output from the fit | 6 Using covariates to model the p’s | 6.1 Reading in the data | 6.2 Fitting the BTSPAS diagonal model and fixing p and covariates for p.  | 6.3 The output from the fit | 7 Using covariates to model the p’s - prior information about beta coefficients | 7.1 Reading in the data | 7.2 Fitting the BTSPAS diagonal model with no covariates | 7.3 Fitting the BTSPAS diagonal model with using log(flow) and default priors | 7.4 Fitting the BTSPAS diagonal model with using log(flow) and weak prior | 7.5 Fitting the BTSPAS diagonal model with using log(flow) and strong prior | 7.6 Comparing the results of the fits | 8 Adding structure to the p’s with a spline. | 8.1 Reading in the data | 8.2 Fitting the BTSPAS diagonal model and a spline for p.  | 8.3 The output from the fit | 9 References

Last update: 2019-12-04
Started: 2019-12-04

02 Diagonal model with multiple ages
Diagonal Case - Multiple Stocks/Ages | 1 Location of vignette source and code. | 2 Introduction | 2.1 Fixing values of \(p\) or using covariates. | 3 Wild and Hatchery Chinook | 3.1 Reading in the data | 3.2 Fitting the BTSPAS diagonal model | 3.3 The output from the fit | 4 Wild and Hatchery Chinook with YoY and Age 1 fish. | 4.1 Reading in the data | 4.2 Fitting the BTSPAS diagonal model | 4.3 The output from the fit | 5 Wild and Hatchery Steelhead with YoY and Age 1 fish. | 5.1 Reading in the data | 5.2 Fitting the BTSPAS diagonal model | 5.3 The output from the fit | 6 References

Last update: 2019-12-04
Started: 2019-12-04

03 Non-diagonal model
Non-Diagonal Case | 1 Location of vignette source and code. | 2 Introduction | 2.1 Fixing values of \(p\) or using covariates. | 3 Example of basic non-diagonal BTSPAS fit. | 3.1 Reading in the data | 3.2 Preliminary screening of the data | 4 Fitting the BTSPAS non-diagonal model with a log-normal movement distribution. | 4.1 The output from the fit | 5 Fitting the BTSPAS non-diagonal model with a non-parametric movement distribution. | 5.1 The output from the fit | 6 Prior information on the movement probabilities. | 6.1 The output from the fit | 7 References

Last update: 2019-12-04
Started: 2019-12-04

04 Non-diagonal with fall-back model
Non-Diagonal Fall-Back Model | 1 Location of vignette source and code. | 2 Introduction | 2.1 Experimental set-up | 2.2 Fall-back information | 2.3 Fixing values of \(p\) or using covariates. | 3 Example of non-diagonal model with fall-back. | 3.1 Reading in the data | 3.2 Fitting the BTSPAS non-diagonal model with fall-back model with a non-parametric movement distribution. | 3.3 The output from the fit | 4 References

Last update: 2019-12-04
Started: 2019-12-04

05 Bias from incomplete sampling
Bias caused by incomplete sampling | 1 Location of vignette source and code. | 2 Introduction | 2.1 Experimental setup | 2.2 Generation of population | 3 Analysis of dataset stratified to the 3-day strata. | 3.1 Pooled Petersen estimator | 3.2 BTSPAS on the full dataset | 3.3 Exploring the output | 4 Analysis at the 6-day stratum level. | 4.1 Pooled Petersen estimator | 4.2 BTSPAS on the pooled dataset | 4.3 Exploring the output | 5 References

Last update: 2019-12-04
Started: 2019-12-04