Learn R Programming

secr (version 5.0.0)

secr-version5: Changes in secr 5.0

Description

This document explains changes in secr 5.0. Version 5.0 is compatible in most respects with earlier versions, but a few names and one default have been changed without warning. See the NEWS file for a complete list of the changes over time.

Arguments

Potential Gotchas

New generics

Several new generic functions are defined, with methods specifically for `secr' fitted models (esa, fxi, fxTotal).

New names

Some functions with "." in their name have been renamed to avoid confusion with methods for generics.

Where possible, the old names have been deprecated (tagged with a warning), and will continue to work for a while.

OldNew
buffer.contourbufferContour
esa.plotesaPlot
fxi.contourfxiContour
fxi.modefxiMode
fxi.secrfxi (generic)
fx.totalfxTotal (generic)
pdot.contourpdotContour

fxi.secr has been replaced by the generic fxi. Thus instead of
fxi.secr(secrdemo.0, i = 1, X = c(365,605)) use
fxi(secrdemo.0, i = 1, X = c(365,605)).

New default

AIC and related functions now default to criterion = "AIC" instead of criterion = "AICc".

Some of us have been uneasy for a long time about blanket use of the AICc small-sample adjustment to AIC (Hurvich and Tsai 1989). Royle et al. (2014) expressed doubts because the sample size itself is poorly defined. AICc is widely used, but AIC may be better for model averaging even when samples are small (Turek and Fletcher 2012; Fletcher 2019, p. 60).

New features

New data blackbearCH

secr 5.0 includes a new black bear DNA hair snag dataset from the Great Smoky Mountains, Tennessee (thanks to J. Laufenberg, F. van Manen and J. Clark).

Goodness-of-fit MCgof

The method of Choo et al. (2024) for emulating the Bayesian p-value goodness-of-fit test (Gelman 1996, Royle et al. 2014) has been implemented as the generic MCgof with a method for `secr' fitted models. I thank Yan Ru Choo for his assistance.

This is a new approach and should be used with caution. Bugs may yet be found, and the power of the tests is limited.

Extended capability

These extensions allow MCgof to cover a wider range of models:

  • detectpar optionally returns values for each detector

  • pdot accepts detector- and occasion-specific detection parameters

Changes behind the scenes

The code for area-search and transect-search models (detector types `polygonX', `polygon', `transectX', `transect') has been streamlined with a view to removing it to another package. Simulation for these models (functions sim.capthist, sim.detect) will remain in secr, but uses native R functions rather than RcppNumerical of Qiu et al. (2023).

The undocumented detection function `HPX' has been removed.

References

Choo, Y. R., Sutherland, C. and Johnston, A. (2024) A Monte Carlo resampling framework for implementing goodness-of-fit tests in spatial capture-recapture models Methods in Ecology and Evolution DOI: 10.1111/2041-210X.14386.

Efford, M. G. (2024) secr: Spatially explicit capture-recapture models. R package version 5.0.0. https://CRAN.R-project.org/package=secr

Fletcher, D. (2019) Model averaging. SpringerBriefs in Statistics. Berlin: Springer-Verlag.

Hurvich, C. M. and Tsai, C. L. (1989) Regression and time series model selection in small samples. Biometrika 76, 297--307.

Gelman, A., Meng, X.-L., and Stern, H. (1996) Posterior predictive assessment of model fitness via realized discrepancies. Statistica Sinica 6, 733--807.

Qiu, Y., Balan, S., Beall, M., Sauder, M., Okazaki, N. and Hahn, T. (2023) RcppNumerical: 'Rcpp' Integration for Numerical Computing Libraries. R package version 0.6-0. https://CRAN.R-project.org/package=RcppNumerical

Royle, J. A., Chandler, R. B., Sollmann, R. and Gardner, B. (2014) Spatial capture--recapture. Academic Press.

Turek, D. and Fletcher, D. (2012) Model-averaged Wald confidence intervals. Computational statistics and data analysis 56, 2809--2815.

See Also

secr-deprecated, secr-defunct