Learn R Programming

shotGroups (version 0.3)

groupSpread: 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, plots = TRUE, level = 0.95,
            CEPtype = c('Rayleigh', 'Grubbs', 'RAND'),
            sigmaType=c('Rayleigh', 'Gauss'),
            dstTarget = 100, conversion = 'm2cm')

## S3 method for class 'data.frame':
groupSpread(xy, plots = TRUE, level = 0.95,
            CEPtype = c('Rayleigh', 'Grubbs', 'RAND'),
            sigmaType=c('Rayleigh', 'Gauss'),
            dstTarget = 100, conversion = 'm2cm')

## S3 method for class 'default':
groupSpread(xy, plots = TRUE, level = 0.95,
            CEPtype = c('Rayleigh', 'Grubbs', 'RAND'),
            sigmaType=c('Rayleigh', 'Gauss'),
            dstTarget = 100, conversion = 'm2cm')

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 X, Y or Point.X, Point.Y as well as Aim.X
plots
a logical value indicating whether diagrams should be shown.
level
a numerical value giving the level for the confidence intervals (for standard deviations, sigma, RSD, MR) as well as for the coverage of the confidence ellipse.
CEPtype
string indicating which CEP estimate to report from getCEP.
sigmaType
string indicating which estimate to use for precision parameter sigma used in radial standard deviation RSD and mean radius MR.
dstTarget
a numerical value giving the distance to the target - used in MOA calculation. See getMOA.
conversion
how to convert the measurement unit for distance to target to that of the (x,y)-coordinates - used in MOA calculation. See getMOA.

Value

  • A list with the results from the numerical analyses and statistical tests.
  • sdXYstandard deviations of x- and y coordinates (in original measurement units and MOA).
  • sdXciparametric (chi^2) and bootstrap (basic, BCa) confidence intervals for the standard deviation of x-coordinates (1499 replicates, in original measurement units and MOA).
  • sdYciparametric (chi^2) and bootstrap (basic, BCa) confidence intervals for the standard deviation of y-coordinates (1499 replicates, in original measurement units and MOA).
  • sdXYrobrobust standard deviations of x- and y-coordinates (in original measurement units and MOA).
  • covXYcovariance matrix of (x,y)-coordinates.
  • covXYrobrobust estimate of covariance matrix of (x,y)-coordinates.
  • distToCtrmean and median 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 and MOA).
  • sigmaCIparametric (chi^2) and bootstrap (basic, BCa) confidence intervals for sigma (1499 replicates, in original measurement units and MOA).
  • RSDciparametric (chi^2) and bootstrap (basic, BCa) confidence intervals for radial standard deviation RSD (1499 replicates, in original measurement units and MOA).
  • MRciparametric (chi^2) and bootstrap (basic, BCa) confidence intervals for mean radius MR (1499 replicates, in original measurement units and MOA).
  • maxPairDistmaximum pairwise distance between points (center-to-center, a.k.a. maximum spread, in original measurement units and MOA).
  • groupRectwidth and height of bounding box with diagonal and figure of merit FoM (average side length, in original measurement units and MOA).
  • groupRectMinwidth and height of minimum-area bounding box with diagonal and figure of merit FoM (average side length, in original measurement units and MOA).
  • minCircleRadradius for the minimum enclosing circle (in original measurement units and MOA).
  • confElllength of semi-major and semi-minor axis of the confidence ellipse (in original measurement units and MOA).
  • confEllRoblength of semi-major and semi-minor axis of the confidence ellipse based on a robust estimate for the covariance matrix (in original measurement units and MOA).
  • confEllShapeaspect ratio and flattening of the confidence ellipse.
  • confEllShapeRobaspect ratio and flattening of the confidence ellipse based on a robust estimate for the covariance matrix.
  • CEPestimate(s) for the circular error probable (CEP, in original measurement units and MOA).

Details

Explanations and formula for many reported precision measures like 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. 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 matrix
  • a scatterplot of the (x,y)-coordinates together with the bounding box, minimum bounding box, minimum enclosing circle, and maximum group spread
  • a histogram for distances to group center including a fitted Rayleigh distribution as well as a nonparametric kernel density estimate

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

Run this code
# coordinates given by a suitable data frame
res <- groupSpread(DFtalon, CEPtype=c("Rayleigh", "Grubbs"), level=0.95,
                   sigmaType='Rayleigh', dstTarget=10, conversion='m2mm')
names(res)
res$sdXYrob
res$distToCtr
res$maxPairDist
res$CEP

# coordinates given by a matrix
xy <- matrix(round(rnorm(200, 0, 5), 2), ncol=2)
groupSpread(xy, level=0.5, dstTarget=25, conversion='m2cm')

Run the code above in your browser using DataLab