Learn R Programming

secr (version 2.5.0)

fxi: Probability Density of Home Range Centre

Description

Display contours of the probability density function for the estimated location of one or more range centres (f(Xi|wi)), compute values for particular points X, or compute mode of pdf.

Usage

fxi.contour (object, i = 1, sessnum = 1, border = 100, nx = 64,
    levels = NULL, p = seq(0.1,0.9,0.1), plt = TRUE, add = FALSE,
    fitmode = FALSE, plotmode = FALSE, normal = TRUE, ...)
fxi.secr(object, i = 1, sessnum = 1, X, normal = TRUE)
fxi.mode(object, i = 1, sessnum = 1, start = NULL, ...)

Arguments

object
a fitted secr model
i
integer or character vector of individuals for which to plot contours, or a single individual as input to other functions
sessnum
session number if object$capthist spans multiple sessions
border
width of blank margin around the outermost detectors
nx
dimension of interpolation grid in x-direction
levels
numeric vector of confidence levels for Pr(X|wi)
p
numeric vector of contour levels as probabilities
plt
logical to plot contours
add
logical to add contour(s) to an existing plot
fitmode
logical to refine estimate of mode of each pdf
plotmode
logical to plot mode of each pdf
X
2-column matrix of x- and y- coordinates
normal
logical; should values of pdf be normalised?
start
vector of x-y coordinates for maximization
...
additional arguments passed to contour or nlm

Value

  • fxi.contour -- Coordinates of the plotted contours are returned as a list with one component per polygon. The list is returned invisibly if plt = TRUE. An additional component `mode' reports the x-y coordinates of the highest point of each pdf (see Details). fxi.secr -- Vector of probability densities fxi.mode -- List with components `x' and `y'

Details

fxi.contour computes contours of probability density for one or more detection histories. Increase nx for smoother contours. If levels is not set, contour levels are set to approximate the confidence levels in np. fxi.secr computes the probability density for a single detection history; X may contain coordinates for one or several points; a dataframe or vector (x then y) will be coerced to a matrix. fxi.mode finds the maximum of the pdf for a single detection history (i.e. n is of length 1). fxi.mode calls nlm. fxi.contour with fitmode = TRUE uses fxi.mode to find the maximum of each pdf. Otherwise the reported mode is an approximation (mean of coordinates of highest contour). If i is character it will be matched to row names of object$capthist (restricted to the relevant session in the case of a multi-session fit); otherwise it will be interpreted as a row number. Values of the pdf are optionally normalised by dividing by the integral of Pr(wi|X) over the habitat mask in object. If start is not provided then the first detector site is used, but this is not guaranteed to work. The ...argument gives additional control over a contour plot; for example, set drawlabels = FALSE to suppress contour labels.

References

Borchers, D. L. and Efford, M. G. (2008) Spatially explicit maximum likelihood methods for capture--recapture studies. Biometrics 64, 377--385.

See Also

pdot.contour, contour

Examples

Run this code
fxi.secr(secrdemo.0, i = 1, X = c(365,605))

## contour first 5 detection histories
plot(secrdemo.0$capthist)
fxi.contour (secrdemo.0, i = 1:5, add = TRUE,
    plotmode = TRUE, drawlabels = FALSE)

## extract modes only
fxiout <- fxi.contour (secrdemo.0, i = 1:5, plt = FALSE, fitmode = TRUE)
t(sapply(fxiout, "[[", "mode"))

Run the code above in your browser using DataLab