Calculates the points for drawing a confidence ellipsoid
A simple function to calculate the points of
a confidence ellipsoid, by default dist=qchisq(0.975, 2)
getEllipse(loc = c(0, 0), cov = matrix(c(1, 0, 0, 1), ncol = 2), crit = 0.975)
loc |
location vector |
cov |
a |
crit |
the confidence level, default is |
A matrix with two columns containing the calculated points.
Valentin Todorov, valentin.todorov@chello.at
data(hbk) cc <- cov.wt(hbk) e1 <- getEllipse(loc=cc$center[1:2], cov=cc$cov[1:2,1:2]) e2 <- getEllipse(loc=cc$center[1:2], cov=cc$cov[1:2,1:2], crit=0.99) plot(X2~X1, data=hbk, xlim=c(min(X1, e1[,1], e2[,1]), max(X1,e1[,1], e2[,1])), ylim=c(min(X2, e1[,2], e2[,2]), max(X2,e1[,2], e2[,2]))) lines(e1, type="l", lty=1, col="red") lines(e2, type="l", lty=2, col="blue") legend("topleft", legend=c(0.975, 0.99), lty=1:2, col=c("red", "blue"))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.