Learn R Programming

secrdesign (version 2.9.2)

minsimRSE: Optimal Spacing by Simulation

Description

A method to obtain a unique `optimal' spacing from previously simulated scenaios for detector spacing.

Usage

# S3 method for optimalSpacing
minsimRSE(object, cut = 0.2, plt = FALSE, verbose = FALSE, incr = 0.1, ...)

Value

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 lm

fitted

dataframe of points on fitted curve

R

optimum R

RSE

minimum RSE

Arguments

object

optimalSpacing object

cut

numeric maximum \(\Delta\) RSE to include

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 plot.optimalSpacing

Details

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

See Also

optimalSpacing

Examples

Run this code

# \donttest{

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)

# }

Run the code above in your browser using DataLab