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

getEllipse

Calculates the points for drawing a confidence ellipsoid


Description

A simple function to calculate the points of a confidence ellipsoid, by default dist=qchisq(0.975, 2)

Usage

getEllipse(loc = c(0, 0), cov = matrix(c(1, 0, 0, 1), ncol = 2), crit = 0.975)

Arguments

loc

location vector

cov

a pXp covariance matrix

crit

the confidence level, default is crit=0.975

Value

A matrix with two columns containing the calculated points.

Author(s)

Valentin Todorov, valentin.todorov@chello.at

Examples

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"))

rrcov

Scalable Robust Estimators with High Breakdown Point

v1.5-5
GPL (>= 2)
Authors
Valentin Todorov [aut, cre] (<https://orcid.org/0000-0003-4215-0245>)
Initial release
2020-07-31

We don't support your browser anymore

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