| plotProxy {ipsecr} | R Documentation |
Simulate and plot the relationship between a parameter and its designated proxy
Description
As described in the vignette, each parameter is matched to a proxy value computed cheaply from the rawdata by the proxy function. This function provides a visual check on that relationship.
Usage
plotProxy(parameter = "sigma", proxyfn = proxy.ms, traps, mask, detectfn = "HHN",
noccasions = 5, basepar = list(), xvals = NULL, nrepl = 100, add = FALSE,
trend = TRUE, points = FALSE, boxplot = TRUE, boxplotargs = list(),
link = "log", details = NULL, ...)
Arguments
parameter |
character parameter of interest |
proxyfn |
function to compute vector of proxy values from a capthist object |
traps |
traps object |
mask |
habitat mask object |
detectfn |
numeric or character code for detection function (see detectfn) |
noccasions |
integer number of sampling occasions |
basepar |
named list with central values of parameters |
xvals |
specified values of focal paramater to simulate (optional) |
nrepl |
integer number of simulations |
add |
logical; if TRUE any plot is added to an existing plot |
trend |
logical; if TRUE a least-squares trend line is plotted |
points |
logical; if TRUE each simulated value is plotted |
boxplot |
logical; if TRUE a boxplots is plotted for each level of the focal parameter |
boxplotargs |
list of arguments for |
link |
character link function for transforming parameter x-axis |
details |
not used |
... |
other arguments passed to plot() |
Details
Simulation uses the internal functions simpop and simCH.
boxplotargs may be used to override or add to the arguments of boxplot.
This version of plotProxy() does not allow for interference (NT) and assumes a simple SECR model with only 3 or 4 coefficients corresponding to density D and the parameters of the detection model (lambda0 or g0, sigma and possibly z).
Matching of proxies at the level of ‘beta’ parameters may be enabled in a future version.
Value
The simulated proxy values are returned invisibly as a matrix (nrepl x nlevels).
See Also
Examples
# try with small number of replicates
trps <- traps(captdata)
msk <- make.mask(trps, buffer = 100)
base <- list(D = 5, lambda0 = 0.2, sigma = 25)
out <- plotProxy (parameter = 'D', traps = trps, mask = msk,
basepar = base, boxplotargs = list(col='orange'), nrepl = 20)