## confidence set for the Kernel Density Diagram
# input data
n = 400
XX = circleUnif(n)
## Ranges of the grid
Xlim=c(-1.8,1.8)
Ylim=c(-1.6,1.6)
by=0.05
h = .3 #bandwidth for the function kde
#Kernel Density Diagram of the superlevel sets
Diag=gridDiag(XX, kde, Xlim, Ylim, by=by, sublevel=FALSE, printStatus=TRUE, h=h)
# confidence set
B=15 ## the number of bootstrap iterations should be higher!
## this is just an example
alpha=0.05
cc=bottleneckInterval(XX, kde, Xlim, Ylim, by=by, sublevel=FALSE, B=B, alpha=alpha,
dimension=1, printStatus=TRUE, h=h)
plot(Diag, band=2*cc)
Run the code above in your browser using DataLab