| rangeStat {shotGroups} | R Documentation |
Distribution of range statistics
Description
Approximate cumulative distribution function, quantile function and random deviates of range statistics based on a lookup table generated by simulations. Includes extreme spread (ES), figure of merit (FoM), bounding box diagonal (D). This function assumes a circular bivariate normal shot distribution with 0 mean.
Usage
pRangeStat(q, sigma = 1, nPerGroup = 5, nGroups = 1, stat = c("ES", "FoM", "D"),
lower.tail = TRUE, loUp)
qRangeStat(p, sigma = 1, nPerGroup = 5, nGroups = 1, stat = c("ES", "FoM", "D"),
method = c("linear", "spline"), lower.tail = TRUE)
rRangeStat(n, sigma = 1, nPerGroup = 5, nGroups = 1, stat = c("ES", "FoM", "D"))
Arguments
q |
vector of quantiles. |
p |
vector of probabilities. Must be within [0.005, 0.995]. |
n |
number of observations. Must be <= 100. If |
stat |
character string indicating the range statistic. One of |
nPerGroup |
integer between 2 and 100. Number of shots in each group. |
nGroups |
integer between 1 and 10. Number of groups. For |
sigma |
numeric value > 0 indicating the Rayleigh scale parameter (common standard deviation of the underlying normal distribution of each 2D-coordinate). See |
lower.tail |
logical. If |
method |
method for bivariate interpolation if both, |
loUp |
search interval for numerical root finding. A vector with the lower and upper interval boundary. See details. |
Details
Based on the lookup table DFdistr with results form a Monte Carlo simulation. If the value either for p or for nPerGroup is missing from the lookup table, a monotone spline interpolation between the neighboring simulated values is used.
pRangeStat is implemented through numerical root finding of qRangeStat. If no search interval for uniroot is provided, whole interval of probabilities available in DFdistr is used. NA is returned for quantiles corresponding to probabilities outside of the available range.
Value
pRangeStat gives the cumulative distribution function, qRangeStat gives the quantile function, rRangeStat generates random deviates.
References
http://ballistipedia.com/index.php?title=Range_Statistics
See Also
DFdistr,
range2sigma,
Rayleigh,
interp,
mba.surf,
Examples
(q45 <- pRangeStat(c(4, 5), sigma=1.5, n=5, nGroups=3, stat="ES"))
# should be the 4 and 5
qRangeStat(q45, sigma=1.5, n=5, nGroups=3, stat="ES")
rRangeStat(5, sigma=2, nPerGroup=5, nGroups=3, stat="D")