Skip to contents

Produces a confidence ellipse that is an iso-contour of the Gaussian distribution, allowing to visualize a 2D confidence interval.

Usage

ellipse(
  x,
  conf = 0.95,
  np = 100,
  plot = TRUE,
  fill = "green",
  alpha = 0.3,
  random_fill = TRUE
)

Arguments

x

A matrix, a data.frame or a list of perimeter coordinates, often produced with object_contour().

conf

The confidence level. Defaults to 0.95

np

Number of sampled points on the ellipse.

plot

Create a plot? Defaults to TRUE.

fill

The color to fill the ellipse. Defaults to "green".

alpha

The alpha value to define the opacity of ellipse. Defaults to 0.3

random_fill

Fill multiple ellipses with random colors? Defaults to TRUE.

Value

A matrix with coordinates of points sampled on the ellipse.

Note

Borrowed from Claude (2008), pp. 85

References

Claude, J. (2008) Morphometrics with R, Use R! series, Springer 316 pp.

Examples

if (interactive() && requireNamespace("EBImage")) {
library(pliman)
ellipse(contours)
}