Package: Petersen 2025.3.1

Carl Schwarz

Petersen: Estimators for Two-Sample Capture-Recapture Studies

A comprehensive implementation of Petersen-type estimators and its many variants for two-sample capture-recapture studies. A conditional likelihood approach is used that allows for tag loss; non reporting of tags; reward tags; categorical, geographical and temporal stratification; partial stratification; reverse capture-recapture; and continuous variables in modeling the probability of capture. Many examples from fisheries management are presented.

Authors:Carl Schwarz [aut, cre]

Petersen_2025.3.1.tar.gz
Petersen_2025.3.1.tar.gz(r-4.5-noble)Petersen_2025.3.1.tar.gz(r-4.4-noble)
Petersen_2025.3.1.tgz(r-4.4-emscripten)Petersen_2025.3.1.tgz(r-4.3-emscripten)
Petersen.pdf |Petersen.html
Petersen/json (API)
NEWS

# Install 'Petersen' in R:
install.packages('Petersen', repos = 'https://cloud.r-project.org')

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

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

On CRAN:

Conda:

jagscpp

3.00 score 317 downloads 27 exports 77 dependencies

Last updated 1 months agofrom:1f402dcd12. Checks:3 OK. Indexed: no.

TargetResultLatest binary
Doc / VignettesOKMar 26 2025
R-4.5-linuxOKMar 26 2025
R-4.4-linuxOKMar 26 2025

Exports:cap_hist_to_n_m_uexpitfit_classeslogitLP_AICcLP_BTSPAS_estLP_BTSPAS_fit_DiagLP_BTSPAS_fit_NonDiagLP_CL_fitLP_estLP_est_adjustLP_fitLP_for_rev_fitLP_IS_estLP_IS_fitLP_IS_printLP_modavgLP_SPAS_estLP_SPAS_fitLP_summary_statsLP_test_equal_mfLP_test_equal_recapLP_TL_estLP_TL_fitLP_TL_simulaten1_n2_m2_to_cap_histsplit_cap_hist

Dependencies:abindactuarAICcmodavgbackportsbbmlebdsmatrixbootBTSPAScheckmateclicodacolorspacecpp11data.tabledplyrexpintexpmfansifarverformula.toolsgenericsggforceggplot2gluegridExtragtableisobandjsonlitelabelinglatticelifecyclemagrittrMASSMatrixmgcvmsmmunsellmvtnormnlmenumDerivoperator.toolspillarpkgconfigplyrpolyclippurrrR2jagsR2WinBUGSR6rbibutilsRColorBrewerRcppRcppArmadilloRcppEigenRdpackreformulasreshape2rjagsrlangscalesSPASstringistringrsurvivalsystemfontstibbletidyrtidyselectTMBtweenrunmarkedutf8vctrsVGAMviridisLitewithrxtable

PackageDocumentation

Rendered fromPackageDocumentation.Rmdusingknitr::rmarkdownon Mar 26 2025.

Last update: 2023-11-12
Started: 2023-11-12

Citation

To cite the Petersen package in publications use:

Schwarz, C. J (2023). The Petersen-Estimator (and many more) for Two-Sample Capture-Recapture Studies with Applications to Fisheries Management. R Package.

Corresponding BibTeX entry:

  @Manual{,
    title = {The Petersen-Estimator (and many more) for Two-Sample
      Capture-Recapture Studies with Applications to Fisheries
      Management {R} {Petersen} Package},
    author = {Carl James Schwarz},
    year = {2023},
  }

Readme and manuals

Petersen

Use of the Petersen Capture-Recapture estimates in fisheries management.

Versions and installation

  • CRAN Download the Petersen package

  • 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/Petersen", dependencies = TRUE,
                        build_vignettes = TRUE)

Features

Extensive user manual available at:

https://github.com/cschwarz-stat-sfu-ca/Petersen/tree/master/PetersenMonograph

The Petersen-method is the simplest of more general capture-recapture methods which are extensively reviewed in Williams et al. (2002). Despite the Petersen method's simplicity, many of the properties of the estimator, and the effects of violations of assumptions are similar to these more complex capture-recapture studies. Consequently, a firm understanding of the basic principles learned from studying this method are extremely useful to develop an intuitive understanding of the larger class of studies.

The purpose of this R package is to bring together a wide body of older and newer literature on the design and analysis of the "simple" two-sample capture-recapture study. This monograph builds upon the comprehensive summaries found in Ricker (1975), Seber (1982), and William et AL (2002), and incorporates newer works that have not yet summarized. While the primary emphasis is on the application to fisheries management, the methods are directly applicable to many other studies.

The core of the package is the use of conditional likelihood estimation that allows for covariates which are not observed on animals not handled.

The packages includes functions for the analysis of

  • simple studies with no covariates or strata
  • simple stratified-Petersen studies or fixed continuous covariates
  • incompletely stratified studies where only a sub-sample is stratified to save costs
  • geographically stratified studies (wrapper to SPAS)
  • temporally-stratified studies (wrapper to BTSPAS)
  • double tagging studies including reward tagging studies
  • multiple-Petersen studies (call RMark/MARK and use mark-resight methods therein)
  • forward and reverse-Petersen studies and their combination

References

Petersen, C. G. J. (1896). The Yearly Immigration of Young Plaice into the Limfjord from the German Sea, Etc. Report Danish Biological Station 6, 1--48.

Seber, G. A. F. (1982). The Estimation of Animal Abundance and Related Parameters. 2nd ed. London: Griffin.

Williams, B. K., J. D. Nichols, and M. J. Conroy. (2002). Analysis and Management of Animal Populations. New York: Academic Press.

Help Manual

Help pageTopics
Convert capture history data to n, m and u for use in BTSPAScap_hist_to_n_m_u
Estimating abundance of outgoing smolt - BTSPAS - diagonal casedata_btspas_diag1
Estimating abundance of salmon - BTSPAS - non-diagonal casedata_btspas_nondiag1
Capture-recapture on Kokanee in Metolius River with tag lossdata_kokanee_tagloss
Lower Fraser Coho for Reverse Capture-Recapture with geographic stratification.data_lfc_reverse
Capture-recapture experiment on Northern Pike in Mille Lacs, MN, in 2005.data_NorthernPike
Capture-recapture experiment on Northern Pike in Mille Lacs, MN, in 2005 with tagloss information.data_NorthernPike_tagloss
Capture-recapture experiment at Rodli Tarn.data_rodli
Simulated data for reward tags used to estimate reporting ratedata_sim_reward
Simulated data for tag loss with second permanent tag.data_sim_tagloss_t2perm
Simulated data for tag loss with 2 distinguishable tags.data_sim_tagloss_twoD
Estimating abundance of salmon - SPAS - Harrison Riverdata_spas_harrison
Walleye data with incomplete stratification with length covariatedata_wae_is_long
Walleye data with incomplete stratification with no covariates and condenseddata_wae_is_short
Yukon River data used for Reverse Capture-Recapture example.data_yukon_reverse
*LP_fit*, *LP_IS_fit*, *LP_SPAS_cit*, *CL_fit*, *LP_BTSPAS_fit_Diag*, *LP_BTSPAS_fit_NonDiag*, *LP_CL_fit* classes.fit_classes
Logit and anti-logit function.expit logit
Create an AIC table comparing multiple LP fitsLP_AICc
Extract estimates of abundance after BTSPAS fitLP_BTSPAS_est
Wrapper (*_fit) to call the Time Stratified Petersen Estimator with Diagonal Entries function in BTSPAS.LP_BTSPAS_fit_Diag
Wrapper (*_fit) to call the Time Stratified Petersen Estimator with NON-Diagonal Entries function in BTSPAS.LP_BTSPAS_fit_NonDiag
Fit the Chen-Lloyd model to estimate abundance using a non-parametric smoother for a covariatesLP_CL_fit
Estimate abundance after the LP conditional likelihood fit.LP_est
Estimate abundance after empirical adjustments for various factors.LP_est_adjust
Fit a Lincoln-Petersen Model using conditional likelihoodLP_fit
Fit a combined FORWARD and REVERSE simple Lincoln-Petersen Model using pseudo-likelihoodLP_for_rev_fit
Estimate abundance after the LP_IS conditional likelihood fit.LP_IS_est
Fit a Lincoln-Petersen Model with incomplete stratificationLP_IS_fit
Print the results from a fit a Lincoln-Petersen Model with incomplete stratificationLP_IS_print
Create an table of individual estimates and the model averaged valuesLP_modavg
Extract estimates of abundance after SPAS fitLP_SPAS_est
Fit a Stratified-Petersen SPAS model.LP_SPAS_fit
Compute summary statistics from the capture historiesLP_summary_stats
Test for equal marked fractions in LP experimentLP_test_equal_mf
Test for equal recapture probability in LP experimentLP_test_equal_recap
Estimate abundance after the LP_TL (tag loss) conditional likelihood fit.LP_TL_est
Fit a Lincoln-Petersen Model with Tag Loss using conditional likelihoodLP_TL_fit
Simulate data from a Lincoln-Petersen Model with Tag LossLP_TL_simulate
Convert n1, n2, m2 to capture history data for use in estimating. Vectors are transformed to strata.n1_n2_m2_to_cap_hist
Split a vector of capture histories into a matrix with one column for each occasionsplit_cap_hist