Estimate population density by simulation and inverse prediction (Efford 2004; Efford, Dawson & Robbins 2004). A restricted range of SECR models may be fitted.
ipsecr.fit(capthist, proxyfn = proxy.ms, model = list(D ~ 1, g0 ~ 1, sigma ~ 1),
mask = NULL, buffer = 100, detectfn = "HN", binomN = NULL, start = NULL,
link = list(), fixed = list(), timecov = NULL, sessioncov = NULL,
details = list(), verify = TRUE, verbose = TRUE, ncores = NULL,
seed = NULL, ...)
An object of class 'ipsecr', a list comprising:
the function call (if details$savecall)
input
input
input
input
input
input
input
input
input
input
input
list of design data for density
list of design data for trap-specific models
mapping of coefficients (beta parameters) to real parameters
names of covariates in model
names of coefficients
names of 'real' parameters
integer completion code: 1 successful, 2 target not within final box, 3 exceeded maximum simulations
estimates of coefficients on link scale
variance-covariance matrix of estimates
vertices of final box (design points)
last lm model fit
total number of simulations
number of successful variance simulations
optional simulation output (see details$keep.sim)
optional simulation input (see details$keep.sim)
dataframe summarising simulations for variance estimation
package version
time execution started
processor time (seconds)
RNG state
(The order and composition of the output list may change).
secr capthist object including capture data and detector (trap) layout
function to compute proxy from capthist for each coefficient (beta parameter)
list with optional components each symbolically defining a linear
predictor for one real parameter using formula notation
mask object
scalar mask buffer radius in metres if mask not specified
integer code or character string for shape of detection function 0 = halfnormal, 1 = hazard rate etc. -- see detectfn
integer code for distribution of counts (see Details)
vector of initial values for beta parameters, or ipsecr
object from which they may be derived
list with optional components corresponding to `real' parameters (e.g., `D', `g0', `sigma'), each a character string in {"log", "logit", "identity", "sin"} for the link function of one real parameter
list with optional components corresponding to real parameters giving the scalar value to which the parameter is to be fixed
optional dataframe of values of time (occasion-specific) covariate(s). NOT USED
optional dataframe of values of session-specific covariate(s)
list of additional settings, to control estimation (see Details)
logical, if TRUE the input data are checked with verify
logical, if TRUE then messages are output during execution
integer number of cores to use for parallel processing
either NULL or an integer that will be used in a call to set.seed
other arguments passed to proxy function
The vignette should be consulted for a full exposition.
ncores determines the number of worker processes in a cluster created by makeCluster (default type "FORK" on Unix platforms, otherwise "PSOCK"). If ncores = NULL this defaults to the value from setNumThreads. Simulations are distributed over worker processes using parRapply. There are substantial overheads in running multiple processes: using too many will slow down fitting. With PSOCK clusters (i.e. on Windows) fitting is very often fastest with ncores = 1.
details is used for various specialized settings listed below. These are
also described separately - see details.
| Name | Default | Description |
| boxsize1 | 0.2 | scalar or vector of length np for size of design |
| boxsize2 | 0.05 | as for boxsize1; used from second box onwards |
| boxtype | 'absolute' | `absolute' or `relative' |
| centre | 3 | number of centre points in simulation design |
| dev.max | 0.002 | tolerance for precision of points in predictor space |
| var.nsim | 2000 | number of additional simulations to estimate variance-covariance matrix |
| keep.sim | FALSE | if true then the variance simulations are saved |
| min.nsim | 20 | minimum number of simulations per point |
| max.nsim | 200 | maximum number of simulations per point |
| min.nbox | 2 | minimum number of attempts to `frame' solution |
| max.nbox | 5 | maximum number of attempts to `frame' solution |
| max.ntries | 2 | maximum number of attempts at each simulation |
| distribution | `poisson' | `poisson', `binomial' or `even' |
| binomN | 0 | integer code for distribution of counts (unused) |
| ignorenontarget | FALSE | override nontarget attribute of capthist |
| ignoreusage | FALSE | override usage in traps object of capthist |
| debug | FALSE | stop at arbitrary points in execution (varies) |
| savecall | TRUE | optionally suppress saving of call |
| newdetector | NULL | detector type that overrides detector(traps(capthist)) |
| contrasts | NULL | coding of factor predictors |
| popmethod | `internal' | `internal' or `sim.popn' or a user-provided function |
| CHmethod | `internal' | `internal' or `sim.capthist' or a user-provided function |
| factorial | `full' | `full' or `fractional' design |
| FrF2args | NULL | arguments for FrF2 when factorial = 'fractional' |
| extraparam | NULL | list of starting values for extra parameters (see vignette) |
| forkonunix | TRUE | logical choice between FORK and PSOCK cluster types (not Windows) |
Efford, M. G. (2004) Density estimation in live-trapping studies. Oikos 106, 598--610.
Efford, M. G., Dawson, D. K. and Robbins C. S. (2004) DENSITY: software for analysing capture-recapture data from passive detector arrays. Animal Biodiversity and Conservation 27, 217--228.
proxy.ms,
predict.ipsecr,
summary.ipsecr
# \donttest{
ipsecrdemo <- ipsecr.fit(captdata, ncores = 1, buffer = 100, detectfn = 14, seed = 1237)
# }
Run the code above in your browser using DataLab