View source: R/pointsToEllipsoid.R
pointsToEllipsoid | R Documentation |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.