groupSpread {shotGroups} | R Documentation |
Precision: Spread measures of a single group of bullet holes
Description
Provides spread measures and their graphical representations for a single group of bullet holes.
Usage
groupSpread(xy, center = FALSE, plots = TRUE, CEPlevel = 0.5,
CIlevel = 0.95, CEPtype = 'CorrNormal', bootCI = 'none',
dstTarget, conversion)
## S3 method for class 'data.frame'
groupSpread(xy, center = FALSE, plots = TRUE, CEPlevel = 0.5,
CIlevel = 0.95, CEPtype = 'CorrNormal', bootCI = 'none',
dstTarget, conversion)
## Default S3 method:
groupSpread(xy, center = FALSE, plots = TRUE, CEPlevel = 0.5,
CIlevel = 0.95, CEPtype = 'CorrNormal', bootCI = 'none',
dstTarget, conversion)
Arguments
xy |
either a numerical (n x 2)-matrix with the (x,y)-coordinates of n points (1 row of coordinates per point), or a data frame with either the variables |
center |
logical: center groups to mean (0,0) first? If variable |
plots |
logical: show diagrams? |
CEPlevel |
a numerical value giving the coverage for the CEP and for the confidence ellipse. |
CIlevel |
a numerical value giving the level for the confidence intervals (for standard deviations as well as for Rayleigh sigma, RSD, MR). |
CEPtype |
string indicating which CEP estimate to report from |
bootCI |
a character vector to select which bootstrap confidence interval type to report. Possible types are |
dstTarget |
a numerical value giving the distance to the target - used in MOA calculation. Acts as override if variable |
conversion |
how to convert the measurement unit for distance to target to that of the (x,y)-coordinates in MOA calculation. Acts as override if variables |
Details
Explanations and formula for many reported precision measures such as CEP, sigma, RSD, MR, FoM can be found in the references.
Robust estimate for the covariance matrix of (x,y)-coordinates is from covMcd
using the MCD algorithm.
The number of replicates for the reported bootstrap confidence intervals is at least 1499. If the BCa interval is reported, it is at least the number of points.
In addition to the numerical results listed below, this function produces the following diagrams:
a scatterplot of the (x,y)-coordinates together with group center, circle with average distance to center, and 100*
level
%-confidence ellipse - the latter also based on a robust estimate for the covariance matrixa scatterplot of the (x,y)-coordinates together with the bounding box, minimum bounding box, minimum enclosing circle, and maximum group spread
a histogram of distances to group center including a fitted Rayleigh distribution as well as a non-parametric kernel density estimate
If package shiny
is installed, an interactive web app for this functionality can be run with runGUI("analyze")
.
Value
A list with the results from the numerical analyses and statistical tests.
sdXY |
standard deviations of x- and y-coordinates (in original measurement units, MOA, SMOA, milliradian). |
sdXci |
parametric (chi^2) and bootstrap confidence intervals for the standard deviation of x-coordinates (in original measurement units, MOA, SMOA, milliradian). |
sdYci |
parametric (chi^2) and bootstrap confidence intervals for the standard deviation of y-coordinates (in original measurement units, MOA, SMOA, milliradian). |
sdXYrob |
robust standard deviations of x- and y-coordinates (in original measurement units, MOA, SMOA, milliradian). |
covXY |
covariance matrix of (x,y)-coordinates. |
covXYrob |
robust estimate of covariance matrix of (x,y)-coordinates. |
distToCtr |
mean, median and maximum distance from points to their center as well as estimated Rayleigh parameters sigma (precision), radial standard deviation RSD, and mean radius MR (in original measurement units, MOA, SMOA, milliradian). |
sigmaCI |
parametric (chi^2) and bootstrap confidence intervals for sigma (in original measurement units, MOA, SMOA, milliradian). |
RSDci |
parametric (chi^2) and bootstrap confidence intervals for radial standard deviation RSD (number of points), in original measurement units, MOA, SMOA, milliradian). |
MRci |
parametric (chi^2) and bootstrap confidence intervals for mean radius MR (in original measurement units, MOA, SMOA, milliradian). |
maxPairDist |
maximum pairwise distance between points (center-to-center, = maximum spread, in original measurement units, MOA, SMOA, milliradian). |
groupRect |
width and height of bounding box with diagonal and figure of merit FoM (average side length, in original measurement units, MOA, SMOA, milliradian). |
groupRectMin |
width and height of minimum-area bounding box with diagonal and figure of merit FoM (average side length, in original measurement units, MOA, SMOA, milliradian). |
minCircleRad |
radius for the minimum enclosing circle (in original measurement units, MOA, SMOA, milliradian). |
minEll |
length of semi-major and semi-minor axis of the minimum enclosing ellipse (in original measurement units, MOA, SMOA, milliradian). |
confEll |
length of semi-major and semi-minor axis of the confidence ellipse (in original measurement units, MOA, SMOA, milliradian). |
confEllRob |
length of semi-major and semi-minor axis of the confidence ellipse based on a robust estimate for the covariance matrix (in original measurement units, MOA, SMOA, milliradian). |
confEllShape |
aspect ratio of the confidence ellipse (square root of condition index |
confEllShapeRob |
aspect ratio and flattening of the confidence ellipse based on a robust estimate for the covariance matrix as well as its trace and determinant. |
CEP |
estimate(s) for the circular error probable (CEP, in original measurement units, MOA, SMOA, milliradian). |
References
http://ballistipedia.com/index.php?title=Describing_Precision
http://ballistipedia.com/index.php?title=Measuring_Precision
See Also
getDistToCtr
,
getMaxPairDist
,
getBoundingBox
,
getMinBBox
,
getMinCircle
,
getConfEll
,
getCEP
,
getRayParam
,
getMOA
,
hist
,
boot
,
boot.ci
,
kernel
,
covMcd
Examples
# coordinates given by a suitable data frame
res <- groupSpread(DFtalon, CEPtype=c('Grubbs', 'Rayleigh'), CEPlevel=0.5,
CIlevel=0.95, bootCI='none', dstTarget=10, conversion='m2mm')
names(res)
res$sdXYrob
res$distToCtr
res$maxPairDist
res$CEP
# coordinates given by a matrix
## Not run:
xy <- matrix(round(rnorm(200, 0, 5), 2), ncol=2)
groupSpread(xy, CEPlevel=0.5, CIlevel=0.95, dstTarget=25, conversion='m2cm')
## End(Not run)