powered by
Compute the x-y coordinates of an error ellipse.
ellipse(mean, cov, alpha = 0.05, n = 50)
a two-column matrix of plot coordinates
two-element vector with the centre of the ellipse
the 2 x 2 covariance matrix of x and y
2 x 2
x
y
confidence level of the ellipse
the number of points at which the ellipse is evaluated
X <- rnorm(100,mean=100,sd=1) Y <- rnorm(100,mean=100,sd=1) Z <- rnorm(100,mean=100,sd=5) dat <- cbind(X/Z,Y/Z) plot(dat) ell <- ellipse(mean=colMeans(dat),cov=cov(dat)) polygon(ell)
Run the code above in your browser using DataLab