Test whether a set of points are inside or outside a defined ellipse
Takes a i x d matrix of points where d is the dimension of the
space considered, and i is the number of points and returns
TRUE or FALSE for whether each point is inside or outside a
d-dimensional ellipsoid defined by a covariance matrix Sigma and
vector of means mu.
pointsToEllipsoid(X, Sigma, mu)
X |
the |
Sigma |
the |
mu |
the vector of means of the ellipse of length |
A matrix of transformed data points corresponding to X
X <- matrix(runif(200,-2.5, 2.5), ncol = 2, nrow = 100) SIG <- matrix(c(1,0,0,1), ncol = 2, nrow = 2) mu <- c(0, 0) Z <- pointsToEllipsoid(X, SIG, mu) test <- ellipseInOut(Z, p = 0.95) plot(X, col = test + 1, xlim = c(-3, 3), ylim = c(-3, 3), asp = 1) addEllipse(mu, SIG, p.interval = 0.95)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.