mvee: mvee

Description Usage Arguments Value Note

Description

Computes the minimum volume enclosing ellipsoid around a set of points using the Khachiyan Algorithm. In two dimensions, this is equivalent to the bounding ellipse.

Usage

1
2
mvee(xy = NULL, tolerance = 0.005, plotme = FALSE, max.iter = 500,
  shiftxy = TRUE, no.ellipse.val = 1, checks = TRUE)

Arguments

xy

a two-column data frame containing x and y coordinates. If NULL then a random sample set of 10 points will be generated

tolerance

a tolerance value

plotme

Plot the points and ellipse (T/F)

max.iter

Maximum number of iterations before giving up. If the script tries this number of iterations but still can't get to the tolerance value, it displays an error message and returns NULL

shiftxy

Apply a shift to the coordinates to make them smaller and speed up the matrix calculations, then reverse the shift to the center point of the resulting ellipoid (T/F)

no.ellipse.val

Determines what the function returns if a mvee can not be found (e.g., if the points are colinear). The default value 1 means a NULL will be returned. A value of 2 means a list of NAs will be returned which is more useful if these values will be stored in a data frame.

checks

Check xy object for the correct data type and remove any duplicate points. T/F

Value

A list containing the "center form" matrix equation of the ellipse. i.e. a 2x2 matrix "A" and a 2x1 vector "C" representing the center of the ellipse such that: (x - C)' A (x - C) <= 1 List elements include A - 2x2 matrix C - 2x1 vector of the center coordinates elps.axes.lngth - 2x1 vector whose elements are one-half the lengths of the major and minor axes (i.e., variables a and b in the standard ellipse equation) alpha - angle of rotation

Note

Adapted by Andy Lyons from Matlab code by Nima Moshtagh. Copyright (c) 2009, Nima Moshtagh http://www.mathworks.com/matlabcentral/fileexchange/9542 http://www.mathworks.com/matlabcentral/fileexchange/13844 http://stackoverflow.com/questions/1768197/bounding-ellipse


tlocoh documentation built on May 2, 2019, 5:27 p.m.