runEllipseSim: Run SECR simulations with Elliptical or Circular Home Ranges

View source: R/runEllipseSim.R

runEllipseSimR Documentation

Run SECR simulations with Elliptical or Circular Home Ranges

Description

A wrapper for other bvn functions.

Usage


runEllipseSim(nrepl = 100, sigmaX = 25, sigmaY = 25, theta = NULL,
    type = c("uniform","BVN"), g0 = 0.2, lambda0 = 0.4, p = 0.95, 
    traps = NULL, trapargs = NULL, noccasions = 5, buffer = 100, 
    D = 10, extractfn = derived, seed = NULL, 
    ncores = NULL, Ndist = "fixed",
    secrfn = c("secr.fit", "anisotropic.fit"), ...) 

Arguments

nrepl

integer number of replicates

sigmaX

numeric or function

sigmaY

numeric

theta

real orientation of ellipses (radians)

type

uniform ellipse vs bivariate normal

g0

numeric intercept of detection function (type = "uniform")

lambda0

numeric intercept of hazard function (type = "BVN")

p

numeric truncation probability for uniform elliptical home ranges

traps

secr traps object, or function to generate one

trapargs

list of arguments for trap building function, if is.function(traps)

noccasions

integer number of sampling occasions

buffer

real width of simulation and estimation buffer metres

D

real population density animals/ha

extractfn

function used to summarise each simulated model fit

seed

integer random number seed

ncores

integer number of cores to use (used in 1.3.0 to setNumThreads)

secrfn

character; name of function to call or NULL

Ndist

character string for distribution of number of individuals (see sim.popn)

...

other arguments passed to secrfn

Details

If traps is not specified, a default 6 x 6 grid of binary proximity detectors is constructed with make.grid.

If sigmaX is a function it is used as in simpopn.bvn to generate individual home ranges (population attribute ‘s2xy’).

If sigmaY = NULL simulates detections of animals with circular halfnormal and uniform home ranges using sim.capthist, rather than the ad hoc code in simcapt.bvn. This is technically redundant as the same result may be achieved with sigmaX = sigmaY, but is a useful check.

Value

A list with one component for each replicate, comprising a list with components

npop

number of individuals in simulated population

nCH

number of individuals detected

ncapt

number of detections

And, if secrfn not NULL,

fit

result of extractfn applied to fitted secr model (default, a 2 x 4 matrix from derived

pred

result of predict applied to fitted secr model (default, a 2 x 5 data.frame)

See Also

simpopn.bvn, simcapt.bvn, secr.fit, anisotropic.fit

Examples

## Not run: 
nrepl <- 20
tr <- make.grid(6,6, spacing = 50, detector = "proximity")
sigmaX <- 25/2; sigmaY <- 25*2
details <- list(distribution = "binomial")
sims <- runEllipseSim (nrepl, sigmaX, sigmaY, buffer = 200, ncores = 2, 
                       traps = tr, g0 = 0.2, D = 4, CL = TRUE, 
                       details = details) 

## End(Not run)

MurrayEfford/secrBVN documentation built on Oct. 14, 2022, 5:20 a.m.