Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pointsToEllipsoid

Test whether a set of points are inside or outside a defined ellipse


Description

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.

Usage

pointsToEllipsoid(X, Sigma, mu)

Arguments

X

the i x d matrix of data points to be transformed

Sigma

the d x d covariance matrix of the ellipsoid

mu

the vector of means of the ellipse of length d

Value

A matrix of transformed data points corresponding to X

Examples

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)

SIBER

Stable Isotope Bayesian Ellipses in R

v2.1.6
GPL (>= 2)
Authors
Andrew Jackson and Andrew Parnell
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.