ipsecr.fit {ipsecr}R Documentation

Spatially Explicit Capture–Recapture by Inverse Prediction

Description

Estimate population density by simulation and inverse prediction (Efford 2004; Efford, Dawson & Robbins 2004). A restricted range of SECR models may be fitted.

Usage


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, ...)

Arguments

capthist

secr capthist object including capture data and detector (trap) layout

proxyfn

function to compute proxy from capthist for each coefficient (beta parameter)

model

list with optional components each symbolically defining a linear predictor for one real parameter using formula notation

mask

mask object

buffer

scalar mask buffer radius in metres if mask not specified

detectfn

integer code or character string for shape of detection function 0 = halfnormal, 1 = hazard rate etc. – see detectfn

binomN

integer code for distribution of counts (see Details)

start

vector of initial values for beta parameters, or ipsecr object from which they may be derived

link

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

fixed

list with optional components corresponding to real parameters giving the scalar value to which the parameter is to be fixed

timecov

optional dataframe of values of time (occasion-specific) covariate(s). NOT USED

sessioncov

optional dataframe of values of session-specific covariate(s)

details

list of additional settings, to control estimation (see Details)

verify

logical, if TRUE the input data are checked with verify

verbose

logical, if TRUE then messages are output during execution

ncores

integer number of cores to use for parallel processing

seed

either NULL or an integer that will be used in a call to set.seed

...

other arguments passed to proxy function

Details

The vignette should be consulted for a full exposition.

Parallel computation

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.

The ‘details’ argument

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)

Value

An object of class 'ipsecr', a list comprising:

call

the function call (if details$savecall)

capthist

input

proxyfn

input

model

input

mask

input

detectfn

input

start

input

link

input

fixed

input

timecov

input

sessioncov

input

details

input

designD

list of design data for density

trapdesigndata

list of design data for trap-specific models

parindx

mapping of coefficients (beta parameters) to real parameters

vars

names of covariates in model

betanames

names of coefficients

realnames

names of 'real' parameters

code

integer completion code: 1 successful, 2 target not within final box, 3 exceeded maximum simulations

beta

estimates of coefficients on link scale

beta.vcov

variance-covariance matrix of estimates

designbeta

vertices of final box (design points)

sim.lm

last lm model fit

ip.nsim

total number of simulations

var.nsim.OK

number of successful variance simulations

simulations

optional simulation output (see details$keep.sim)

parameters

optional simulation input (see details$keep.sim)

variance.bootstrap

dataframe summarising simulations for variance estimation

version

package version

starttime

time execution started

proctime

processor time (seconds)

seed

RNG state

(The order and composition of the output list may change).

References

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.

See Also

proxy.ms, predict.ipsecr, summary.ipsecr

Examples




ipsecrdemo <- ipsecr.fit(captdata, ncores = 1, buffer = 100, detectfn = 14, seed = 1237)




[Package ipsecr version 1.4.1 Index]