minsimRSE | R Documentation |
A method to obtain a unique ‘optimal’ spacing from previously simulated scenaios for detector spacing.
## S3 method for class 'optimalSpacing'
minsimRSE(object, cut = 0.2, plt = FALSE, verbose = FALSE, incr = 0.1, ...)
object |
optimalSpacing object |
cut |
numeric maximum |
plt |
logical; if TRUE a plot is generated |
verbose |
logical; if TRUE then output includes fitted model |
incr |
numeric spacing of computed points (R) |
... |
other arguments passed to |
A quadratic is fitted to the simulated RSE (y) vs simulationR (x), including only values of x and y for which y \le \mbox{min}(y) \times (1+\mbox{cut})
. The restriction allows the user to exclude extreme x-values for which the quadratic is a poor fit.
The optimum is the minimum of the quadratic ax^2 + bx + c
, given by -b/2a
.
The quadratic is fitted with lm
(lm(RSE.mean ~ R + I(R^2)
).
When verbose = FALSE
, a numeric vector with optimum R (multiple of sigma) and corresponding RSE.
When verbose = TRUE
, a list with components –
model |
fitted model from |
fitted |
dataframe of points on fitted curve |
R |
optimum R |
RSE |
minimum RSE |
optimalSpacing
grid <- make.grid(8, 8, spacing = 20, detector = 'proximity')
# method = "none" uses the shortcut variance
tmp <- optimalSpacing(D = 5, traps = grid, detectfn = "HHN", detectpar =
list(lambda0 = 1, sigma = 20), noccasions = 1, nx = 32,
fit.function = "secr.fit", method = "none", simulationR = seq(1.2,2.2,0.2))
minsimRSE(tmp, plt = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.