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.
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"))
pRangeStat
gives the cumulative distribution function, qRangeStat
gives the quantile function, rRangeStat
generates random deviates.
vector of quantiles.
vector of probabilities. Must be within [0.005, 0.995].
number of observations. Must be <= 100. If length(n) > 1
, the length is taken to be the number required.
character string indicating the range statistic. One of "ES"
(extreme spread), "FoM"
(figure of merit), or "D"
(bounding box diagonal).
integer between 2 and 100. Number of shots in each group.
integer between 1 and 10. Number of groups. For nGroups
> 1, the quantile of the average range statistic is returned.
numeric value > 0 indicating the Rayleigh scale parameter (common standard deviation of the underlying normal distribution of each 2D-coordinate). See Rayleigh
.
logical. If TRUE
(default), probabilities are \(P[X \le x]\) otherwise, \(P[X > x]\).
method for bivariate interpolation if both, p
and nPerGroup
, are missing from the lookup table. "linear"
for bilinear interpolation (requires installing package interp
), "spline"
for bivariate spline approximation (requires installing package MBA
).
search interval for numerical root finding. A vector with the lower and upper interval boundary. See 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.
DFdistr
,
range2sigma
,
Rayleigh
,
interp
,
mba.surf
,
(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")
Run the code above in your browser using DataLab