simdataClosedSCR: Simulate spatially-explicit capture-mark-recapture data from...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/ClosedSCR.R

Description

This function generates encounter histories from spatially-explicit capture-mark-recapture data consisting of multiple non-invasive marks.

Usage

1
2
3
4
5
simdataClosedSCR(N = 30, ntraps = 9, noccas = 5, pbeta = 0.25,
  tau = 0, sigma2_scr = 0.75, lambda = 0.75, delta_1 = 0.4,
  delta_2 = 0.4, alpha = 0.5, data.type = "never",
  detection = "half-normal", spatialInputs = NULL, buffer = 3 *
  sqrt(sigma2_scr), ncells = 1024, scalemax = 10, plot = TRUE)

Arguments

N

True population size or abundance.

ntraps

The number of traps. If trapCoords=NULL, the square root of ntraps must be a whole number in order to create a regular grid of trap coordinates on a square.

noccas

Scaler indicating the number of sampling occasions per trap.

pbeta

Complementary loglog-scale intercept term for detection probability (p). Must be a scaler or vector of length noccas.

tau

Additive complementary loglog-scale behavioral effect term for recapture probability (c).

sigma2_scr

Complementary loglog-scale term for effect of distance in the “half-normal” detection function. Ignored unless detection=``half-normal''.

lambda

Complementary loglog-scale term for effect of distance in the “exponential” detection function. Ignored unless detection=``exponential''.

delta_1

Conditional probability of type 1 encounter, given detection.

delta_2

Conditional probability of type 2 encounter, given detection.

alpha

Conditional probability of simultaneous type 1 and type 2 detection, given both types encountered. Only applies when data.type="sometimes".

data.type

Specifies the encounter history data type. All data types include non-detections (type 0 encounter), type 1 encounter (e.g., left-side), and type 2 encounters (e.g., right-side). When both type 1 and type 2 encounters occur for the same individual within a sampling occasion, these can either be "non-simultaneous" (type 3 encounter) or "simultaneous" (type 4 encounter). Three data types are currently permitted:

data.type="never" indicates both type 1 and type 2 encounters are never observed for the same individual within a sampling occasion, and observed encounter histories therefore include only type 1 or type 2 encounters (e.g., only left- and right-sided photographs were collected). Observed encounter histories can consist of non-detections (0), type 1 encounters (1), and type 2 encounters (2). See bobcat. Latent encounter histories consist of non-detections (0), type 1 encounters (1), type 2 encounters (2), and type 3 encounters (3).

data.type="sometimes" indicates both type 1 and type 2 encounters are sometimes observed (e.g., both-sided photographs are sometimes obtained, but not necessarily for all individuals). Observed encounter histories can consist of non-detections (0), type 1 encounters (1), type 2 encounters (2), type 3 encounters (3), and type 4 encounters (4). Type 3 encounters can only be observed when an individual has at least one type 4 encounter. Latent encounter histories consist of non-detections (0), type 1 encounters (1), type 2 encounters (2), type 3 encounters (3), and type 4 encounters (4).

data.type="always" indicates both type 1 and type 2 encounters are always observed, but some encounter histories may still include only type 1 or type 2 encounters. Observed encounter histories can consist of non-detections (0), type 1 encounters (1), type 2 encounters (2), and type 4 encounters (4). Latent encounter histories consist of non-detections (0), type 1 encounters (1), type 2 encounters (2), and type 4 encounters (4).

detection

Model for detection probability as a function of distance from activity centers. Must be "half-normal" (of the form \exp{(-d^2 / (2*σ^2))}, where d is distance) or "exponential" (of the form \exp{(-d / λ)}).

spatialInputs

A list of length 3 composed of objects named trapCoords, studyArea, and centers:

trapCoords is a matrix of dimension ntraps x (2 + noccas) indicating the Cartesian coordinates and operating occasions for the traps, where rows correspond to trap, the first column the x-coordinate (“x”), and the second column the y-coordinate (“y”). The last noccas columns indicate whether or not the trap was operating on each of the occasions, where ‘1’ indciates the trap was operating and ‘0’ indicates the trap was not operating.

studyArea is a 3-column matrix defining the study area and available habitat. Each row corresponds to a grid cell. The first 2 columns (“x” and “y”) indicate the Cartesian x- and y-coordinate for the centroid of each grid cell, and the third column (“avail”) indicates whether the cell is available habitat (=1) or not (=0). All grid cells must have the same resolution. Note that rows should be ordered in raster cell order (raster cell numbers start at 1 in the upper left corner, and increase from left to right, and then from top to bottom).

centers is a N-vector indicating the grid cell (i.e., the row of studyArea) that contains the true (latent) activity centers for each individual in the population.

If spatialInputs=NULL (the default), then all traps are assumed to be operating on all occasions, the study area is assumed to be composed of ncells grid cells, grid cells within buffer of the trap array are assumed to be available habitat, and the activity centers are randomly assigned to grid cells of available habitat.

buffer

A scaler indicating the buffer around the bounding box of trapCoords for defining the study area and available habitat when spatialInputs=NULL. Default is buffer=3*sqrt(sigma2_scr). Ignored unless spatialInputs=NULL.

ncells

The number of grid cells in the study area when studyArea=NULL. The square root of ncells must be a whole number. Default is ncells=1024. Ignored unless spatialInputs=NULL.

scalemax

Upper bound for grid cell centroid x- and y-coordinates. Default is scalemax=10, which scales the x- and y-coordinates to be between 0 and 10. Ignored unless spatialInputs=NULL.

plot

Logical indicating whether to plot the simulated trap coordinates, study area, and activity centers using plotSpatialData. Default is plot=TRUE

Details

Please be very careful when specifying your own spatialInputs; multimarkClosedSCR and markClosedSCR do little to verify that these make sense during model fitting.

Value

A list containing the following:

Enc.Mat

Matrix containing the observed encounter histories with rows corresponding to individuals and (ntraps*noccas) columns corresponding to traps and sampling occasions. The first noccas columns correspond to trap 1, the second noccas columns corresopond to trap 2, etc.

trueEnc.Mat

Matrix containing the true (latent) encounter histories with rows corresponding to individuals and (ntraps*noccas) columns corresponding to traps and sampling occasions. The first noccas columns correspond to trap 1, the second noccas columns corresopond to trap 2, etc.

spatialInputs

List of length 2 with objects named trapCoords and studyArea:

trapCoords is a matrix of dimension ntraps x (2 + noccas) indicating the Cartesian coordinates and operating occasions for the traps, where rows correspond to trap, the first column the x-coordinate, and the second column the y-coordinate. The last noccas columns indicate whether or not the trap was operating on each of the occasions, where ‘1’ indciates the trap was operating and ‘0’ indicates the trap was not operating.

studyArea is a 3-column matrix containing the coordinates for the centroids a contiguous grid of cells that define the study area and available habitat. Each row corresponds to a grid cell. The first 2 columns indicate the Cartesian x- and y-coordinate for the centroid of each grid cell, and the third column indicates whether the cell is available habitat (=1) or not (=0). All cells must have the same resolution.

centers

N-vector indicating the grid cell (i.e., the row of spatialInputs$studyArea) that contains the true (latent) activity centers for each individual in the population.

Author(s)

Brett T. McClintock

References

Bonner, S. J., and Holmberg J. 2013. Mark-recapture with multiple, non-invasive marks. Biometrics 69: 766-775.

McClintock, B. T., Conn, P. B., Alonso, R. S., and Crooks, K. R. 2013. Integrated modeling of bilateral photo-identification data in mark-recapture analyses. Ecology 94: 1464-1471.

Royle, J.A., Karanth, K.U., Gopalaswamy, A.M. and Kumar, N.S. 2009. Bayesian inference in camera trapping studies for a class of spatial capture-recapture models. Ecology 90: 3233-3244.

See Also

processdataSCR, multimarkClosedSCR, markClosedSCR

Examples

1
2
#simulate data for data.type="sometimes" using defaults
data<-simdataClosedSCR(data.type="sometimes")

multimark documentation built on Jan. 11, 2020, 9:31 a.m.