powered by
Draw a two-dimensional ellipse that traces a bivariate normal density contour for a given mean vector, covariance matrix, and probability content.
ellipse(mu, sigma, alpha = .05, npoints = 250, newplot = FALSE, draw = TRUE, ...)
ellipse returns an npointsx2 matrix of the points forming the border of the ellipse.
ellipse
npoints
A 2-vector giving the mean.
A 2x2 matrix giving the covariance matrix.
Probability to be excluded from the ellipse. The default value is alpha = .05, which results in a 95% ellipse.
Number of points comprising the border of the ellipse.
If newplot = TRUE and draw = TRUE, plot the ellipse on a new plot. If newplot = FALSE and draw = TRUE, add the ellipse to an existing plot.
If TRUE, draw the ellipse.
Graphical parameters passed to lines or plot command.
lines
plot
Johnson, R. A. and Wichern, D. W. (2002) Applied Multivariate Statistical Analysis, Fifth Edition, Prentice Hall.
regcr
## Produce a 95% ellipse with the specified mean and covariance structure. mu <- c(1, 3) sigma <- matrix(c(1, .3, .3, 1.5), 2, 2) ellipse(mu, sigma, npoints = 200, newplot = TRUE)
Run the code above in your browser using DataLab