## contourLevels kde
x <- rmvnorm.mixt(n=100, mus=c(0,0), Sigmas=diag(2), props=1)
Hx <- Hpi(x)
fhatx <- kde(x=x, H=Hx)
lev1 <- contourLevels(fhatx, prob=c(0.25, 0.5, 0.75))
lev2 <- contourLevels(fhatx, cont=c(75, 50, 25)) ## lev1==lev2
## contourLevels kda.kde
library(MASS)
data(iris)
ir <- iris[,1]
ir.gr <- iris[,5]
kda.fhat <- kda.kde(ir, ir.gr, hs=sqrt(c(0.01, 0.04, 0.07)))
contourLevels(kda.fhat, prob=c(0.25, 0.5, 0.75))
## contourSizes kde
x <- rmvnorm.mixt(n=1000, mus=c(0,0), Sigmas=diag(2), props=1)
Hx <- Hpi(x, binned=TRUE)
fhat <- kde(x=x, H=Hx, binned=TRUE)
plot(fhat, cont=25, xlim=c(-1,1), ylim=c(-1,1), asp=1)
contourSizes(fhat, cont=25, approx=TRUE)
## compare to approx circle of radius=0.75, vol=pi*0.75^2=1.767146
Run the code above in your browser using DataLab