Learn R Programming

secr (version 3.0.1)

suggest.buffer:

Description

Determines a suitable buffer width for an integration mask. The `buffer' in question defines a concave polygon around a detector array constructed using make.mask with type = "trapbuffer". The method relies on an approximation to the bias of maximum likelihood density estimates (M. Efford unpubl).

Usage

suggest.buffer(object, detectfn = NULL, detectpar = NULL, 
    noccasions = NULL, ignoreusage = FALSE, RBtarget = 0.001,
    interval = NULL, binomN = NULL, ...)

bias.D (buffer, traps, detectfn, detectpar, noccasions, binomN = NULL, control = NULL)

Arguments

object
single-session `secr', `traps' or `capthist' object
detectfn
integer code or character string for shape of detection function 0 = halfnormal etc. -- see detectfn
detectpar
list of values for named parameters of detection function -- see detectpar
noccasions
number of sampling occasions
ignoreusage
logical for whether to discard usage information from traps(capthist)
RBtarget
numeric target for relative bias of density estimate
interval
a vector containing the end-points of the interval to be searched
binomN
integer code for distribution of counts (see secr.fit)
...
other argument(s) passed to bias.D
buffer
vector of buffer widths
traps
`traps' object
control
list of mostly obscure numerical settings (see Details)

Value

suggest.buffer returns a scalar value for the suggested buffer width in metres, or a vector of such values in the case of a multi-session object.

bias.D returns a dataframe with columns buffer and RB.D (approximate bias of density estimate using finite buffer width, relative to estimate with infinite buffer).

Details

The basic input style of suggest.buffer uses a `traps' object and a detection model specified by `detectpar', `detectfn' and `noccasions', plus a target relative bias (RB). A numerical search is conducted for the buffer width that is predicted to deliver the requested RB. If interval is omitted it defaults to (1, 100S) where S is the spatial scale of the detection function (usually detectpar$sigma). An error is reported if the required buffer width is not within interval. This often happens with heavy-tailed detection functions (e.g., hazard-rate): choose another function, a larger RBtarget or a wider interval.

Convenient alternative input styles are --

  • secr object containing a fitted model. Values of `traps', `detectpar', `detectfn' and `noccasions' are extracted from object and any values supplied for these arguments are ignored.

  • capthist object containing raw data. If detectpar is not supplied then autoini is used to get `quick and dirty' values of g0 and sigma for a halfnormal detection function. noccasions is ignored. autoini tends to underestimate sigma, and the resulting buffer also tends to be too small.
  • bias.D is called internally by suggest.buffer.

    See Also

    mask, make.mask, mask.check, esa.plot

    Examples

    Run this code
    
    ## Not run: ------------------------------------
    # temptraps <- make.grid()
    # detpar <-  list(g0 = 0.2, sigma = 25)
    # suggest.buffer(temptraps, "halfnormal", detpar, 5)
    # 
    # RB <- bias.D(50:150, temptraps, "halfnormal", detpar, 5)
    # plot(RB)
    # 
    # detpar <-  list(g0 = 0.2, sigma = 25, z=5)
    # RB <- bias.D(50:150, temptraps, "hazard rate", detpar, 5)
    # lines(RB)
    # 
    # ## compare to esa plot
    # esa.plot (temptraps, max.buffer = 150, spacing = 4, detectfn = 0,
    #   detectpar = detpar, noccasions = 5, as.density = F)
    ## ---------------------------------------------
    
    ## compare detection histories and fitted model as input
    suggest.buffer(captdata)
    suggest.buffer(secrdemo.0)
    

    Run the code above in your browser using DataLab