sim.capthist(traps, popn = list(D = 5, buffer = 100,
Ndist = "poisson"), detectfn = 0, detectpar = list(),
noccasions = 5, nsessions = 1, binomN = NULL,
p.available = 1, renumber = TRUE, seed = NULL,
maxperpoly = 100)
sim.resight(traps, ..., q = 1, pID = 1, unmarked = TRUE,
nonID = TRUE)
traps
object with the locations and other attributes of detectorspopn
object or a list with named components `D' (density) and `buffer'sim.capthist
sim.capthist
, an object of class capthist
, a matrix or
3-dimensional array with additional attributes. Rows represent
individuals and columns represent occasions; the third dimension, used
when detector type = `proximity', codes presence or absence at each
detector. For trap detectors (`single', `multi') each entry in
capthist
is either zero (no detection) or the sequence number of
the trap.
The initial state of the R random number generator is stored in the
`seed' attribute.
For sim.resight
, an object of class capthist
, always a
3-dimensional array, with additional attributes Tu and Tm containing
counts of `unmarked' and `marked, not identified' sightings.popn
is not of class `popn' then a homogeneous Poisson
population with the desired density (animals/ha) is first simulated over
the rectangular area of the bounding box of traps
plus a buffer
of the requested width (metres). The detection algorithm depends on the
detector type of traps
. For `proximity' detectors, the actual
detection probability of animal i at detector j is the
naive probability given by the detection function. For `single' and
`multi' detectors the naive probability is modified by competition
between detectors and, in the case of `single' detectors, between animals. See
Efford (2004) and other papers below for details.
Detection parameters in detectpar
are specific to the detection
function, which is indicated by a numeric code (detectfn
).
Parameters may vary with time - for this provide a vector of length
noccasions
. The default detection parameters are list(g0 =
0.2, sigma = 25, z = 1)
.
The default is to simulate a single session. This may be overridden by
providing a list of populations to sample (argument popn
) or by
specifying nsessions
> 1 (if both then the number of sessions must
match). Using nsessions
> 1 results in replicate samples of
populations with the same density etc. as specified directly in the
popn
argument.
binomN
determines the statistical distribution of the number of
detections of an individual at a particular `count' detector or polygon
on a particular occasion. A Poisson distribution is indicated by
binomN = 0
; see secr.fit
for more. The distribution
is always Bernoulli (binary) for `proximity' and `signal' detectors.
p.available
specifies temporary non-availability for detection in
multi-session simulations. If a single probability is specified then
temporary non-availability is random (independent from session to
session). If two probabilities are given then non-availability is
Markovian (dependent on previous state) and the two values are for
animals available and not available at the preceding session. In the
Markovian case, availability in the first session is assigned at random
according to the equilibrium probability p2 / (1 - p1 + p2). Incomplete
availability is not implemented for sampling lists of populations.
detectpar
may include a component `truncate' for the distance
beyond which detection probability is set to zero. By default this value
is NULL (no specific limit).
If popn
is specified by an object of class `popn' then any
individual covariates will be passed on; the covariates
attribute
of the output is otherwise set to NULL.
The random number seed is managed as in simulate
.
sim.resight
generates mark-resight data for `q' marking occasions
followed by `noccasions -- q' sighting occasions. sim.capthist
is
first called with the arguments `traps' and .... The detector type
must be `proximity'. The `usage' attribute of traps
is ignored at
present, so the same detectors are operated on all occasions. Any
detection-parameter vector of length 2 in ...is interpreted as
providing differing constant values for the marking and sighting phases.sim.popn
, capthist
, traps
,
popn
, detection functions
, simulate
## simple example
## detector = "multi" (default)
temptrap <- make.grid(nx = 6, ny = 6, spacing = 20)
sim.capthist (temptrap, detectpar = list(g0 = 0.2, sigma = 20))
## with detector = "proximity", there may be more than one
## detection per individual per occasion
temptrap <- make.grid(nx = 6, ny = 6, spacing = 20, detector =
"proximity")
summary(sim.capthist (temptrap, detectpar =
list(g0 = 0.2, sigma = 20)))
## multiple sessions
grid4 <- make.grid(nx = 2, ny = 2)
temp <- sim.capthist (grid4, popn = list(D = 1), nsessions = 20)
summary(temp, terse = TRUE)
## unmarked or presence types
grid <- make.grid(nx = 10, ny = 10, detector = "unmarked")
CH <- sim.capthist (grid, noccasions = 5)
CH
## "presence" and "unmarked" data are stored as "count" data
## behaviour is controlled by detector type, e.g.
detector(traps(CH)) <- "presence"
CH
Run the code above in your browser using DataLab