---
title: '**secr** 5.3 - spatially explicit capture--recapture in R'
author: "Murray Efford"
date: "`r Sys.Date()`"
output: 
  pdf_document: 
    toc: yes
    toc_depth: 2
vignette: > 
  %\VignetteIndexEntry{Spatially explicit capture--recapture in R}
  \usepackage[utf8]{inputenc}
  %\VignetteEngine{knitr::rmarkdown}
---

\vspace{12pt}

This document provides a compact overview of **secr** 5.3, an R package for spatially explicit capture--recapture analysis (SECR).  For background on SECR and a tutorial see the SECR book, [Efford (2025)].  

Add-on packages extend the capability of **secr** and are documented separately. 

* **secrlinear** enables the estimation of linear density (e.g., animals per km) for populations in linear habitats such as stream networks ([secrlinear-vignette.pdf][]). 
* **ipsecr** fits models by simulation and inverse prediction, rather than maximum likelihood; this is a rigorous way to analyse data from single-catch traps ([ipsecr-vignette.pdf][]). 
* **secrdesign** enables the assessment of alternative study designs by  Monte Carlo simulation; scenarios may differ in detector (trap) layout, sampling intensity, and other characteristics ([secrdesign-vignette.pdf][]). 
* **openCR** implements spatial open-population capture--recapture models (Efford and Schofield 2020)  ([openCR-vignette.pdf][]).

# Introduction to SECR

Spatially explicit capture--recapture (SECR) is a set of methods for
modelling animal capture--recapture data collected with an array of
'detectors'. The methods are used primarily to estimate population
density, but they also have advantages over non-spatial methods when
the goal is to estimate population size in a region defined by the researcher. 

SECR methods overcome edge effects that are problematic in
conventional capture--recapture estimation of animal populations (Otis
et al. 1978).  Detectors may be live-capture traps, with animals
uniquely tagged, sticky traps or snags that passively sample hair,
from which individuals are distinguished by their microsatellite DNA,
or cameras that take photographs from which individuals are recognized
by their natural marks. The concept of a detector extends to areas (polygons)
or transects that are searched for animals or their sign.

The primary data for SECR are (i) the locations of the detectors, and (ii) detections of known individuals on one or more sampling occasions (i.e. their detection histories). The generic terms 'detector' and 'detections' cover several possibilities (see 'Detector types' below); we use them interchangeably with the more specific and familiar terms 'traps' and 'captures'. Table 1 gives a concrete example of trapping data (the structure differs for detectors that are not traps).

\vspace{12pt}

**Table 1.** Some spatially explicit detection data. Each entry (e.g., A9) records the detector at which a known animal (ID) was observed at each sample time (occasion). '.' indicates no detection. Each detector has known x-y coordinates. Formats for data input are described in [secr-datainput.pdf].  
```
              Occasion
 ID      1     2     3     4     5  
----- ----- ----- ----- ----- ----- 
  1     A9     .     .     .     .  
  2    A12   A12     .     .     .  
  3      .     .    C6    B5     .  
  4      .     .    G3     .    F3  
  etc.       
```

In SECR, a spatial model of the population and a spatial model of the detection process are fitted to the spatial detection histories. The resulting estimates of population density are unbiased by edge effects and incomplete detection (other sources of bias may remain). Inverse prediction (IP SECR) and maximum likelihood (ML SECR) are alternative methods for fitting the spatial detection model (Efford 2004, Borchers and Efford 2008). Of these, ML SECR is the more flexible, with a caveat for data from single-catch traps. Data augmentation and Markov chain Monte Carlo (MCMC) methods have also been used for SECR (Royle and Young 2008, Royle et al. 2009, Singh et al. 2010, Royle and Gardner 2011, Royle et al. 2014, Turek et al. 2021); this approach is slower than ML SECR and is not considered here.

## State and observation models

Like other statistical methods for estimating animal abundance
(Borchers et al. 2002), SECR combines a state model and an observation
model. The state model describes the distribution of animal home
ranges in the landscape, and the observation model (a spatial
detection model) relates the probability of detecting an individual at
a particular detector to the distance of the detector from a central
point in each animal's home range.  The distances are not observed
directly (usually we don't know the range centres), so conventional
distance sampling methods do not apply.

## Distribution of home-range centres

The distribution of range centres in the population (Borchers and
Efford 2008) will usually be treated as a homogeneous Poisson point
process (Fig. 1a). Density (= intensity) is the sole parameter of a homogeneous Poisson
process. An inhomogeneous Poisson distribution may also be fitted; this
provides a means to evaluate the effects of habitat variables on
density.

## Detection functions

A detection model describes the decline in detection probability with distance ($d$)
from the home-range centre (Fig. 1b). The probability $g(d)$ is for the 'ideal'
case of just one animal and one detector; the actual probability may differ
(see discussion of 'traps' under Detector Types).


```{r, echo=FALSE, eval=TRUE, message=FALSE}
library(secr)
## Following is not needed as no multithreaded operations in this vignette 
## To avoid ASAN/UBSAN errors on CRAN, following advice of Kevin Ushey
## e.g. https://github.com/RcppCore/RcppParallel/issues/169
Sys.setenv(RCPP_PARALLEL_BACKEND = "tinythread")
```

```{r, echo=FALSE, eval=TRUE}
options(digits=6, width=85)
```

\vspace{8pt}

```{r, echo = FALSE, eval=TRUE, fig.height=3.5, fig.width=7}
par(mfrow=c(1,2), pty='s', mar=c(2,1,2,2), cex=1.2, las = 1, bty = 'l',
    xpd=T, cex=1.2, xaxs='i', yaxs='i', lwd=1.5)

plot(sim.popn(D=5, core=make.grid(), buffer=150), cex=1)
plot(make.grid(),add=T, detpar=list(col = "red", pch = 3, cex = 1.2))
text(-160,300,'a.', cex=1.3)

par(mar=c(4,5,2,2))
plot(0,0, type='n', xlim=c(0,800), ylim=c(0,0.15),
   xlab='', ylab='', lwd=2, col='blue', axes = FALSE)
plot(stoat.model.HN, limits=FALSE, xv=0:800, ylim=c(0,0.12),
   xlab='', ylab='', lwd=2, col='blue', add = TRUE)
axis (1)
mtext(side=1, line=2.5, 'Distance  (m)', cex=1.2)
axis (2, at=c(0, 0.05, 0.10, 0.15))
mtext(side=2, line=3.5, 'Detection probability', cex=1.2, las=0)
plot(stoat.model.EX, add=T, limits=F, xv=1:800, col='green', lwd=2)
legend (260,0.15, lwd=2, col=c('blue', 'green'),
    legend=c('halfnormal','exponential'), bty='n')
text(-450, 0.18,'b.', cex=1.3)
```

**Fig. 1.** (a) Hypothetical Poisson distribution of range centres near an
  array of detectors. Each dot represents one individual. SECR estimates
  the density of this distribution. (b) Alternative detection functions. 
  The halfnormal is defined by $g(d) = g_0\exp\left(\frac{-d^2}{2\sigma^2}\right)$ 
  and the exponential by $g(d) = g_0\exp\left(-\frac{d}{\sigma}\right)$. 
  See ?detectfn for more.

## Detector types

The properties of detectors are an important part of the SECR
observation model (Table 2). Inside **secr**, data are tagged with a
detector type to ensure they are printed, plotted and analysed
appropriately.

Some common detectors (camera 'traps' and hair snags for DNA) do not
capture animals, but merely record that an animal has visited a
site. These 'proximity' detectors can be considered to act
independently of each other. With proximity detectors, each animal
$\times$ occasion 'cell' of a detection history potentially contains
several positive records. In the simplest case each cell contains a
binary vector coding presence or absence at each detector (for such
binary proximity detectors each observation has a Bernoulli
distribution). A 'count' detector is a generalised proximity detector
in which the data are vectors of counts, one per detector. Models for
'count' data will specify a distribution for the counts via the
'binomN' argument of `secr.fit` (binomN = 0 indicates Poisson; binomN > 1
indicates binomial with size = binomN; binomN = 1 indicates binomial
with size given by the 'usage' attribute for the detector and
occasion).

Detectors that are true traps do not act independently because capture
of an animal in one trap prevents it being caught in another trap
until it is released. Traps expose animals to competing risks of
capture. The per-trap probability of capture may be adjusted for the
competing risk from other traps by using an additive hazard model
(Borchers and Efford 2008). However, if the detectors are traps that
catch only one animal at a time then there is a further level of
competition -- between animals for traps. Multi-catch and single-catch
traps therefore represent distinct detector types. No general
adjustment has been found for the per-trap probability of capture in
the single-catch case (it's an open research question), and there is
strictly no known maximum likelihood estimator. Estimates of average density
using the multi-catch likelihood for single-catch data
appear only slightly biased (Efford, Borchers and Byrom 2009), and this
substitution is made automatically in **secr**, with a warning. However, the
substitution is imperfect when density varies (Distiller
and Borchers 2015). Simulation and inverse prediction in **ipsecr** is an
alternative and more robust method for single-catch data.

Polygon and transect detectors are for binary or count detection data
(e.g., number of detections per animal per polygon per occasion)
supplemented with the x-y coordinates of each detection.
When a study uses multiple search areas or multiple transects,
detections may be either independent or dependent (e.g., maximum one
per animal per polygon per occasion) as with traps. The dependent or
'exclusive' type is indicated by the suffix 'X'; in this case the
counts are necessarily binary. Using the 'polygonX' or 'transectX'
detector type ensures that a competing-risk model is fitted.

Acoustic 'signal strength' detectors produce a binary detection vector
supplemented by measurements of signal strength, as from an array of
microphones.

There is limited support in **secr** for the analysis of locational data from telemetry ('telemetry' detector type). Telemetry data are used to augment capture--recapture data (see `addTelemetry`).

\vspace{12pt}

**Table 2.** Detector types in **secr**

| Detector   | Description                               |
|------------|-------------------------------------------|
| single | traps that catch one animal at a time |
| multi | traps that may catch more than one animal at a time |
| proximity | records presence at a point without restricting movement |
| count | proximity detector allowing >1 detection per animal per time |
| polygon | counts from searching one or more areas |
| transect | counts from searching one or more transects |
| polygonX | binary data from mutually exclusive areas |
| transectX | binary data from mutually exclusive transects |
| signal | detections and signal strengths at multiple microphones |
| telemetry | locations from radiotelemetry |

# Outline of the package **secr**

The program DENSITY (Efford et al. 2004, Efford 2012) provides a graphical interface to SECR methods that was used by many
biologists. However, DENSITY has significant drawbacks: it requires the Windows operating system, its algorithms are not always transparent or well-documented, it fits only homogeneous Poisson models, and it omits recent advances in SECR.

The R package **secr** was written to address these weaknesses and allow for further development. It implements almost all the methods described by Borchers and Efford (2008), Efford et al. (2009), Efford (2011), Efford and Fewster (2013), Efford et al. (2013) and Efford and Mowat (2014). **secr** 5.3 uses external C++ code via package **Rcpp** for computationally intensive operations (Eddelbuettel and Francois 2011); Multi-threading on multiple CPUs with **RcppParallel** (Allaire et al. 2021) gives major speed gains. The most important functions of **secr** are listed in [Appendix 1](#appendix1).

## How **secr** works

**secr** defines a set of R classes[^1] and methods for data from
detector arrays and models fitted to those data.

\vspace{12pt}

**Table 3.** Essential classes in **secr**.

| Class   | Data                                        |
|---------|---------------------------------------------|
|  traps  | locations of detectors; detector type ('proximity', 'multi', etc.) |
|  capthist | spatial detection histories, including a 'traps' object |
|  mask   | raster map of habitat near the detectors |
|  secr   | fitted SECR model|

[^1]:Technically, these are S3 classes. A 'class' in R specifies a
  particular type of data object and the functions (methods) by which
  it is manipulated (computed, printed, plotted etc). See the R
  documentation for further explanation.

To perform an SECR analysis you explicitly or implicitly construct each of these objects in turn. Fig. 2 indicates the relationships among the classes.

\setkeys{Gin}{height=95mm, width=140mm,keepaspectratio=TRUE}
![][schematicfigure]

**Fig. 2.** Essentials of the **secr** package.

- Each object class (shaded box) comes with methods to display and manipulate the data it contains (e.g. `print`, `summary`, `plot`, `rbind`, `subset`)[^2].
- The function `read.capthist` forms a 'traps' object from the detector layout data and saves it as an attribute, along with capture data read from another file, in a 'capthist' object.
- By default, a habitat mask is generated automatically by `secr.fit` using a specified buffer around the detectors (traps). The function `make.mask` gives greater control over this step.
- Any of the objects input to `secr.fit` (traps, capthist, mask) may include a dataframe of covariates  saved as an attribute. Covariate names may be used in model formulae; the `covariates` method is used to extract or replace covariates. Use `addCovariates` for covariates from spatial data sources (e.g., shapefile or 'sf' object)
- Fitted secr models may be manipulated with the methods shown on the right and others listed in [Appendix 2](#appendix2).

[^2]:Text in this font refers to R objects that are documented in online help for the **secr** package, or in base R.


## Model fitting and estimation

Models are fitted in `secr.fit` by numerically maximizing the
likelihood. The likelihood involves integration over the unknown
locations of the animals' range centres. This is achieved in practice
by summation over points in the habitat mask, which has some
implications for the user. Computation may be slow, especially if
there are many points in the mask, and estimates may be sensitive to
the particular choice of mask (either explicitly in `make.mask`
or implicitly via the 'buffer' argument).

The default maximization algorithm is Newton-Raphson in the function
`stats::nlm`. By default, all reported variances, covariances,
standard errors and confidence limits are asymptotic and based on a
numerical estimate of the information matrix. The Newton-Raphson
algorithm is fast, but it sometimes fails to compute the information
matrix correctly, causing some standard errors to be set to NA; see
the 'method' argument of `secr.fit` for alternatives. Use
`confint.secr` for profile likelihood intervals and `sim.secr`
for parametric bootstrap intervals (both are slow).

## Habitat masks

We have already introduced the idea of a habitat mask. The SECR
likelihood is evaluated by summing values at points on a
mask; each point represents a grid cell of potentially occupied
habitat. Masks may be constructed by placing a buffer of arbitrary
width around the detectors, possibly excluding known non-habitat. How
wide should the buffer be? The general answer is 'Wide enough not to
cause bias in estimated densities'. This depends on the scale of
movement of the animal, and on the chosen detection function. For
specifics, see [Efford (2025)] and the help for 'mask' and the various mask-related functions (`make.mask`,
`mask.check`, `suggest.buffer`, and `esaPlot`). Heavy-tailed detection
functions such as the hazard-rate and lognormal can be problematic because
they require an unreasonably large buffer for stable density estimates.

## Input

Data input is covered in the separate document [secr-datainput.pdf]. One option is to use text files in the formats used by DENSITY; these accommodate most types of data. Two files are required, one of detector (trap) locations and one of the detections (captures) themselves; the function `read.capthist` reads both files and constructs a capthist object. It is also possible to construct the capthist object in two stages, first making a traps object (with `read.traps`) and a captures dataframe, and then combining these with `make.capthist`. This more general route may be needed for unusual datasets.

## Output

The output from the function `secr.fit` is an object of class
`secr`. This is an R list with many components. Assigning the
output to a named object saves both the fit and the data for further
manipulation. Typing the name at the R prompt invokes
`print.secr` which formats the key results. These include the
dataframe of estimates from the `predict` method for
`secr` objects. Functions are provided for further computations
on `secr` objects (e.g., AIC model selection, model averaging, profile-likelihood confidence
intervals, and likelihood-ratio tests). Many of these are listed in [Appendix 2](#appendix2).

One system of units is used throughout **secr**. Distances are in
metres and areas are in hectares (ha). The unit of density for 2-dimensional habitat is animals per hectare. 1 ha = 10000 m^2^ = 0.01 km^2^. To convert density to animals per
km^2^, multiply by 100. Density in linear habitats (see package **secrlinear**) is expressed in animals per km.

# Documentation

The primary documentation for **secr** is in the help pages that accompany the package. Help for a function is obtained in the usual way by typing a question mark at the R prompt, followed by the function name. Note the 'Index' link at the bottom of each help page -- you will probably need to scroll down to find it. The index may also be accessed with `help(package = secr)`.

The consolidated help pages are in the file [secr-manual.pdf]. Searching this text is a powerful way to locate a function for a particular task.

The web page https://www.otago.ac.nz/density/ should be checked for news of bug fixes and new releases. New versions will be posted on [CRAN], but there may be a delay of a few days. For information on changes in each version, type at the R prompt:

```{r, eval=FALSE}
news (package = "secr")
```

Help may be sought on the Density | secr forum at www.phidot.org. Another forum intended for both software issues and wider discussion is [secrgroup].

# References

Allaire, J. J., Francois, R., Ushey, K., Vandenbrouck, G., Geelnard, M. and Intel (2021)
  RcppParallel: Parallel Programming Tools for 'Rcpp'. R package version 5.1.4.
  https://CRAN.R-project.org/package=RcppParallel.

Borchers, D. L., Buckland, S. T. and Zucchini, W. (2002)
  *Estimating animal abundance: closed populations*. Springer,
  London.

Borchers, D. L. and Efford, M. G. (2008) Spatially explicit maximum likelihood methods for capture--recapture studies. *Biometrics* **64**, 377--385.

Distiller, G. and Borchers, D. L. (2015) A spatially explicit capture--recapture estimator for single-catch traps. *Ecology and Evolution* **5**, 5075--5087.

Eddelbuettel, D. and Francois, R. (2011) Rcpp: Seamless R and C++ Integration. *Journal of
  Statistical Software* **40(8)**, 1--18. https://www.jstatsoft.org/v40/i08/.

Efford, M. G. (2004) Density estimation in live-trapping studies. *Oikos* **106**, 598--610.

Efford, M. G. (2011) Estimation of population density by spatially explicit capture--recapture analysis of data from area searches. *Ecology* **92**, 2202--2207.

Efford, M. G. (2012) *DENSITY 5.0: software for spatially explicit capture--recapture*.  Department of Mathematics and Statistics, University of Otago, Dunedin, New Zealand
  https://www.otago.ac.nz/density.

Efford, M. G. (2023) ipsecr: An R package for awkward spatial capture--recapture data.
  *Methods in Ecology and Evolution* **14**, 1182--1189.
  
Efford, M. G. (2025) The SECR book. A handbook of spatially explicit capture–recapture methods. Version 1.0. Zenodo https://doi.org/10.5281/zenodo.15109937 and https://murrayefford.github.io/SECRbook/.  

Efford, M. G., Borchers D. L. and Byrom, A. E. (2009) Density estimation by spatially explicit capture--recapture: likelihood-based methods. In: D. L. Thomson, E. G. Cooch,
  M. J. Conroy (eds) *Modeling Demographic Processes in Marked Populations*. Springer. Pp 255--269.

Efford, M. G., Borchers D. L. and Mowat, G. (2013) Varying effort in capture--recapture studies. *Methods in Ecology and Evolution* **4**, 629--636.

Efford, M. G., Dawson, D. K. and Borchers, D. L. (2009) Population density estimated from locations of individuals on a passive detector array. *Ecology* **90**, 2676--2682.

Efford, M. G. and Fewster, R. M. (2013) Estimating population size by spatially explicit capture--recapture. *Oikos* **122**, 918--928.

Efford, M. G. and Mowat, G. (2014) Compensatory heterogeneity in spatially explicit capture--recapture data. *Ecology*  **95**, 1341--1348.

Efford, M. G. and Schofield, M. R. (2020) A spatial open-population capture--recapture model.
  *Biometrics* **76**, 392--402.

Otis, D. L., Burnham, K. P., White, G. C. and Anderson, D. R. (1978) Statistical inference from capture data on closed animal populations. *Wildlife Monographs* **62**.

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

Royle, J. A. and Gardner, B. (2011) Hierarchical spatial capture--recapture models for estimating density from trapping arrays. In: A.F. O'Connell, J.D. Nichols and K.U. Karanth (eds) *Camera Traps in Animal Ecology: Methods and Analyses*. Springer, Tokyo.  Pp. 163--190.

Royle, J. A., Nichols, J. D., Karanth, K. U. and Gopalaswamy, A. M. (2009) A hierarchical model for estimating density in camera-trap studies. *Journal of Applied Ecology* **46**, 118--127.

Royle, J. A. and Young, K. V. (2008) A hierarchical model for spatial capture--recapture data. *Ecology* **89**, 2281--2289.

Turek, D., Milleret, C., Ergon, T., Brøseth, H., Dupont, P., Bischof, R., and Valpine, P. de. (2021) Efficient estimation of large‐scale spatial capture--recapture models.*Ecosphere* **12(2)** https://doi.org/10.1002/ecs2.3385

\pagebreak

# Appendix 1. Core functions of **secr** {#appendix1}

These are the core functions of **secr** 5.3 -- the ones that you are most likely to use. S3 methods are marked with an asterisk.

|  Function       | Purpose                                           |
|-----------------|---------------------------------------------------|
| `addCovariates`	| add spatial covariates to traps or mask |
| `AIC`*            | model selection, model weights |
| `covariates`	    | extract or replace covariates of traps, capthist or mask |
| `derived`*        | compute density from conditional likelihood models |
| `make.mask`       | construct habitat mask (= mesh) |
| `plot`*           | plot capthist, traps or mask |
| `read.capthist`   | input captures and trap layout from Density format, one call |
| `predict`*	    | compute 'real' parameters for arbitrary levels of predictor variables |
| `predictDsurface` | evaluate density surface at each point of a mask |
| `region.N`*       | compute expected and realised population size in specified region |
| `secr.fit`        | maximum likelihood fit; result is a fitted 'secr' object |
| `summary`*        | summarise capthist, traps or mask
| `traps`           | extract or replace traps object in capthist |

\pagebreak

# Appendix 2. Classified index to **secr** functions {#appendix2}

Here is an index of **secr** functions classified by use (some minor functions are omitted). S3 methods are marked with an asterisk.

- Manipulate core objects
- Attributes of traps object
- Attributes of capthist object
- Data for each detection
- Operate on fitted model(s)
- Mask diagnostics
- Specialised graphics
- Convert or export data
- Miscellaneous

|  Function          | Purpose                                           |
|----------------------|-------------------------------------------------|
|           |                                                              |
|  **Manipulate data objects** |  |
| &nbsp;&nbsp;&nbsp;&nbsp;`addCovariates`	| add spatial covariates to 'traps' or 'mask' |
| &nbsp;&nbsp;&nbsp;&nbsp; `as.mask`	| coerce 'traps' object to 'mask' for specialised plotting |
| &nbsp;&nbsp;&nbsp;&nbsp; `deleteMaskPoints`	| edit 'mask' |
| &nbsp;&nbsp;&nbsp;&nbsp; `discretize`	| rasterize area-search capthist data |
| &nbsp;&nbsp;&nbsp;&nbsp; `head`*       	| first rows of 'capthist', 'traps' or 'mask' |
| &nbsp;&nbsp;&nbsp;&nbsp; `join`          | combine sessions of multi-session 'capthist' object |
| &nbsp;&nbsp;&nbsp;&nbsp; `make.grid`	| construct detector array |
| &nbsp;&nbsp;&nbsp;&nbsp; `make.capthist`	| form 'capthist' from 'traps' and detection data |
| &nbsp;&nbsp;&nbsp;&nbsp; `make.mask`	| construct habitat mask (mesh) |
| &nbsp;&nbsp;&nbsp;&nbsp; `make.systematic` | construct clustered random systematic design |
| &nbsp;&nbsp;&nbsp;&nbsp; `make.lacework` | construct lacework random systematic design |
| &nbsp;&nbsp;&nbsp;&nbsp; `MS.capthist`   	| combine 'capthist' objects into one multi-session 'capthist' |
| &nbsp;&nbsp;&nbsp;&nbsp; `plot`*     	| plot 'capthist', 'traps' or 'mask' |
| &nbsp;&nbsp;&nbsp;&nbsp; `plotMaskEdge` | draw line around mask cells |
| &nbsp;&nbsp;&nbsp;&nbsp; `randomHabitat`  | generates habitat mask with random landscape |
| &nbsp;&nbsp;&nbsp;&nbsp; `rbind`* | append 'capthist', 'traps', 'popn' or 'mask' objects |
| &nbsp;&nbsp;&nbsp;&nbsp; `read.capthist`	| input captures and trap layout from Density format, one call |
| &nbsp;&nbsp;&nbsp;&nbsp; `read.traps`	| input detector locations from text file |
| &nbsp;&nbsp;&nbsp;&nbsp; `reduce`*	| aggregate detectors or occasions; change detector type |
| &nbsp;&nbsp;&nbsp;&nbsp; `sim.capthist`	| simulate capture histories |
| &nbsp;&nbsp;&nbsp;&nbsp; `sightingPlot`	| bubble plot of sightings in capthist object |
| &nbsp;&nbsp;&nbsp;&nbsp; `snip`     	| split transect(s) into equal sections |
| &nbsp;&nbsp;&nbsp;&nbsp; `split`*     	| split a single-session capthist or mask by various criteria |
| &nbsp;&nbsp;&nbsp;&nbsp; `subset`*     	| filter 'capthist', 'traps' or 'mask' |
| &nbsp;&nbsp;&nbsp;&nbsp; `summary`*     	| summarise 'capthist', 'traps' or 'mask' |
| &nbsp;&nbsp;&nbsp;&nbsp; `tail`*     	| last rows of 'capthist', 'traps' or 'mask' |
| &nbsp;&nbsp;&nbsp;&nbsp; `trap.builder`	| construct various complex designs |
| &nbsp;&nbsp;&nbsp;&nbsp; `verify`*	| check 'capthist', 'traps' or 'mask' for internal consistency |
|           |                                                              |
| **Attributes of traps object** | |
| &nbsp;&nbsp;&nbsp;&nbsp; `clusterID`      | cluster identifier |
| &nbsp;&nbsp;&nbsp;&nbsp; `clustertrap`    | detector number within cluster |
| &nbsp;&nbsp;&nbsp;&nbsp; `covariates`*	| detector-level covariates |
| &nbsp;&nbsp;&nbsp;&nbsp; `detector`*	| detector type ('multi', 'proximity' etc.) |
| &nbsp;&nbsp;&nbsp;&nbsp; `markocc`	| vector distinguishing marking and sighting occasions |
| &nbsp;&nbsp;&nbsp;&nbsp; `polyID`*        | polygon or transect identifier |
| &nbsp;&nbsp;&nbsp;&nbsp; `timevaryingcov`	| name time-varying covariate(s) |
| &nbsp;&nbsp;&nbsp;&nbsp; `usage`*	        | occasion- and detector-specific effort |
|           |                                                              |
| **Attributes of capthist object** | |
| &nbsp;&nbsp;&nbsp;&nbsp; `addSightings`	| add sighting data to a 'proximity', 'count' or 'polygon' object |
| &nbsp;&nbsp;&nbsp;&nbsp; `addTelemetry`	| add telemetry data to a 'proximity' or 'count' object |
| &nbsp;&nbsp;&nbsp;&nbsp; `covariates`*	| individual-level covariates, including grouping factors |
| &nbsp;&nbsp;&nbsp;&nbsp; `session`*	| session identifier(s) |
| &nbsp;&nbsp;&nbsp;&nbsp; `signalmatrix`  	| sound x microphone table |
| &nbsp;&nbsp;&nbsp;&nbsp; `telemetryxy` 	| coordinates of telemetry fixes |
| &nbsp;&nbsp;&nbsp;&nbsp; `Tm`        	| counts of marked animals that were not identified |
| &nbsp;&nbsp;&nbsp;&nbsp; `traps`*	| embedded traps object(s) |
| &nbsp;&nbsp;&nbsp;&nbsp; `Tu`        	| counts of unmarked animals |
|           |                                                              |
| **Data for each detection** | |
| &nbsp;&nbsp;&nbsp;&nbsp; `alive`	        | TRUE/FALSE |
| &nbsp;&nbsp;&nbsp;&nbsp; `animalID`	| individual ID |
| &nbsp;&nbsp;&nbsp;&nbsp; `clusterID`      | cluster identifier |
| &nbsp;&nbsp;&nbsp;&nbsp; `clustertrap`    | detector number within cluster |
| &nbsp;&nbsp;&nbsp;&nbsp; `noise`  	| noise (signal detectors) |
| &nbsp;&nbsp;&nbsp;&nbsp; `occasion`	| occasion |
| &nbsp;&nbsp;&nbsp;&nbsp; `signal`	        | signal strength (signal detectors) |
| &nbsp;&nbsp;&nbsp;&nbsp; `signalframe`  	| whole signal \| noise dataframe (rows = detections) |
| &nbsp;&nbsp;&nbsp;&nbsp; `trap`	        | detector |
| &nbsp;&nbsp;&nbsp;&nbsp; `xy`      	| detection coordinates (polygon and transect detectors)|
|           |                                                              |
| **Fit SECR model(s)** | |
| &nbsp;&nbsp;&nbsp;&nbsp; `list.secr.fit`  | fit several models and return secrlist object |
| &nbsp;&nbsp;&nbsp;&nbsp; `secr.fit`	| maximum likelihood fit; result is a fitted `secr` object |
|           |                                                              |
| **Operate on fitted model(s)** | |
| &nbsp;&nbsp;&nbsp;&nbsp; `adjustVarD` | apply c-hat to density SE and confidence intervals |
| &nbsp;&nbsp;&nbsp;&nbsp; `AIC`*	| model selection, model weights |
| &nbsp;&nbsp;&nbsp;&nbsp; `chat.nj` | overdispersion of activity centres |
| &nbsp;&nbsp;&nbsp;&nbsp; `coef`*	| 'beta' parameters |
| &nbsp;&nbsp;&nbsp;&nbsp; `collate`	| tabulate estimates from several models |
| &nbsp;&nbsp;&nbsp;&nbsp; `confint`*	| profile likelihood confidence intervals |
| &nbsp;&nbsp;&nbsp;&nbsp; `CVa, CVa0`    | CV of individual detection from fitted mixture model |
| &nbsp;&nbsp;&nbsp;&nbsp; `derived`*	| density from conditional likelihood models |
| &nbsp;&nbsp;&nbsp;&nbsp; `deviance`*	| model deviance |
| &nbsp;&nbsp;&nbsp;&nbsp; `df.residual`*	| degrees of freedom for deviance |
| &nbsp;&nbsp;&nbsp;&nbsp; `derivednj` | variance from replicated sampling units |
| &nbsp;&nbsp;&nbsp;&nbsp; `derivedCluster` | variance from replicated sampling units |
| &nbsp;&nbsp;&nbsp;&nbsp; `derivedDcoef` | derive intercept and other coefficients from relative density model |
| &nbsp;&nbsp;&nbsp;&nbsp; `derivedDsurface` | derive absolute density surface from relative density model |
| &nbsp;&nbsp;&nbsp;&nbsp; `derivedExternal` | variance from replicated sampling units |
| &nbsp;&nbsp;&nbsp;&nbsp; `ellipse.secr` | confidence ellipses for estimated parameters |
| &nbsp;&nbsp;&nbsp;&nbsp; `esa`* | effective sampling area by individual |
| &nbsp;&nbsp;&nbsp;&nbsp; `fxi`*       | probability density of home-range centre |
| &nbsp;&nbsp;&nbsp;&nbsp; `LLsurface`* | compute likelihood surface and plot contours |
| &nbsp;&nbsp;&nbsp;&nbsp; `logLik`*	| log-likelihood of fitted model |
| &nbsp;&nbsp;&nbsp;&nbsp; `LR.test`	| likelihood-ratio test of two models |
| &nbsp;&nbsp;&nbsp;&nbsp; `MCgof`*	| Monte Carlo goodness-of-fit after Choo et al. 2024 |
| &nbsp;&nbsp;&nbsp;&nbsp; `modelAverage`*	| combine estimates using AIC or AICc weights |
| &nbsp;&nbsp;&nbsp;&nbsp; `plot`*		| plot detection functions with confidence bands |
| &nbsp;&nbsp;&nbsp;&nbsp; `predict`*	| 'real' parameters for arbitrary levels of predictor variables |
| &nbsp;&nbsp;&nbsp;&nbsp; `predictDsurface`* | evaluate density surface at each point of a mask |
| &nbsp;&nbsp;&nbsp;&nbsp; `region.N`*    | expected and realised population size in specified region |
| &nbsp;&nbsp;&nbsp;&nbsp; `RSE`     | extract precision (relative SE) of 'real' parameter estimates |
| &nbsp;&nbsp;&nbsp;&nbsp; `score.test`	| model selection with score statistic using observed information |
| &nbsp;&nbsp;&nbsp;&nbsp; `secr.test` | Monte Carlo goodness-of-fit tests |
| &nbsp;&nbsp;&nbsp;&nbsp; `simulate`*	| generate realisations of fitted model |
| &nbsp;&nbsp;&nbsp;&nbsp; `sim.secr`	| parametric bootstrap |
| &nbsp;&nbsp;&nbsp;&nbsp; `vcov`*     | variance-covariance matrix of 'beta' or 'real' parameters |
|           |                                                              |
| **Mask diagnostics** | |
| &nbsp;&nbsp;&nbsp;&nbsp; `esaPlot`	| cumulative plot esa or $\hat D$ vs buffer width |
| &nbsp;&nbsp;&nbsp;&nbsp; `mask.check`	| likelihood or estimates vs. buffer width and spacing |[6pt]
| &nbsp;&nbsp;&nbsp;&nbsp; `suggest.buffer`	| find buffer width to keep bias within bounds |
|           |                                                              |
| **Specialised graphics** | |
| &nbsp;&nbsp;&nbsp;&nbsp; `bufferContour`	| concave and convex boundary strips |
| &nbsp;&nbsp;&nbsp;&nbsp; `fxTotal`	| summed pdfs of home-range centre pdfs (use with `plot.Dsurface`) |
| &nbsp;&nbsp;&nbsp;&nbsp; `fxiContour`  | contour plot of home-range centre pdf(s) |
| &nbsp;&nbsp;&nbsp;&nbsp; `pdotContour`	| contour plot of detection probability |
| &nbsp;&nbsp;&nbsp;&nbsp; `strip.legend`	| add colour legend to existing plot |
|           |                                                              |
| **Convert or export data** | |
| &nbsp;&nbsp;&nbsp;&nbsp; `RMarkInput`	| convert 'capthist' to dataframe for RMark |
| &nbsp;&nbsp;&nbsp;&nbsp; `write.capthist`	| export 'capthist' as text files for DENSITY |
| &nbsp;&nbsp;&nbsp;&nbsp; `write.DA`	| convert 'capthist' for analysis in WinBUGS |
| &nbsp;&nbsp;&nbsp;&nbsp; `writeGPS`	| upload coordinates to GPS using GPSBabel |
|          |                                                              |
| **Miscellaneous** | |
| &nbsp;&nbsp;&nbsp;&nbsp; `ARL`		| asymptotic range length|
| &nbsp;&nbsp;&nbsp;&nbsp; `autoini`	| generate starting values of D, g0 and sigma for `secr.fit` |
| &nbsp;&nbsp;&nbsp;&nbsp; `centroids` | centroid of each animal's detections |
| &nbsp;&nbsp;&nbsp;&nbsp; `clone`          | replicate points to emulate overdispersion |
| &nbsp;&nbsp;&nbsp;&nbsp; `closure.test`   | closure tests of Otis et al. (1978) and Stanley \| Burnham (1999) |
| &nbsp;&nbsp;&nbsp;&nbsp; `closedN`	| closed population size by various conventional estimators |
| &nbsp;&nbsp;&nbsp;&nbsp; `counts`		| summary data from 'capthist' object |
| &nbsp;&nbsp;&nbsp;&nbsp; `CV`             | coefficient of variation |
| &nbsp;&nbsp;&nbsp;&nbsp; `dbar`		| mean distance between capture locations |
| &nbsp;&nbsp;&nbsp;&nbsp; `distancetotrap`	| from an arbitrary set of points |
| &nbsp;&nbsp;&nbsp;&nbsp; `edist`    	| Euclidean distance |
| &nbsp;&nbsp;&nbsp;&nbsp; `Enk`       | expected individuals per detector |
| &nbsp;&nbsp;&nbsp;&nbsp; `gridCells` 	| grid cells around points (e.g. traps object) |
| &nbsp;&nbsp;&nbsp;&nbsp; `kfn`		| overlap index for halfnormal home range |
| &nbsp;&nbsp;&nbsp;&nbsp; `MMDM`		| mean maximum distance moved |
| &nbsp;&nbsp;&nbsp;&nbsp; `moves`		| distances between capture locations |
| &nbsp;&nbsp;&nbsp;&nbsp; `nearesttrap`	| from an arbitrary set of points |
| &nbsp;&nbsp;&nbsp;&nbsp; `nedist`        | Non-Euclidean distance |
| &nbsp;&nbsp;&nbsp;&nbsp; `ORL`		| observed range length|
| &nbsp;&nbsp;&nbsp;&nbsp; `pdot`		| location-specific net probability of detection |
| &nbsp;&nbsp;&nbsp;&nbsp; `PG`             | proportion of telemetry fixes in given polygons |
| &nbsp;&nbsp;&nbsp;&nbsp; `pmixProfileLL`  | profile likelihood as function of mixing proportion |
| &nbsp;&nbsp;&nbsp;&nbsp; `RPSV`		| 'root pooled spatial variance', a simple measure of home-range size |
| &nbsp;&nbsp;&nbsp;&nbsp; `setNumThreads` | sets environment variable RCPP_PARALLEL_NUM_THREADS |
| &nbsp;&nbsp;&nbsp;&nbsp; `t2r2` | serial correlation of detection locations |
| &nbsp;&nbsp;&nbsp;&nbsp; `trapsPerAnimal` | frequency distribution of detectors per animal |

[schematicfigure]: schematic3.png

[secr-manual.pdf]: https://www.otago.ac.nz/density/pdfs/secr-manual.pdf
[secr-overview.pdf]: https://www.otago.ac.nz/density/pdfs/secr-overview.pdf
[secr-datainput.pdf]: https://www.otago.ac.nz/density/pdfs/secr-datainput.pdf
[secr-models.pdf]: https://www.otago.ac.nz/density/pdfs/secr-models.pdf
[secr-sound.pdf]: https://www.otago.ac.nz/density/pdfs/secr-sound.pdf
[secrdesign-vignette.pdf]: https://www.otago.ac.nz/density/pdfs/secrdesign-vignette.pdf
[secrlinear-vignette.pdf]: https://CRAN.R-project.org/package=secrlinear/vignettes/secrlinear-vignette.pdf
[ipsecr-vignette.pdf]: https://CRAN.R-project.org/package=ipsecr/vignettes/ipsecr-vignette.pdf
[openCR-vignette.pdf]: https://CRAN.R-project.org/package=openCR/vignettes/openCR-vignette.pdf

[secrgroup]: <https://groups.google.com/forum/#!forum/secrgroup>
[CRAN]: https://cran.r-project.org/package=secr
[Efford (2025)]: https://murrayefford.github.io/SECRbook/