## input data: circle with clutter noise
n=600
percNoise=0.1
XX1 = circleUnif(n)
noise=cbind(runif(percNoise*n, -2,2),runif(percNoise*n, -2,2))
X=rbind(XX1,noise)
## limits of the Gird at which the density estimator is evaluated
Xlim=c(-2,2)
Ylim=c(-2,2)
by=0.2
B=100
alpha=0.05
## candidates
parametersKDE=seq(0.1,0.5, by=0.1)
par(mfrow=c(1,2))
plot(X, pch=16, cex=0.5, main="Circle")
maxKDE=maxPersistence(kde, parametersKDE, X, Xlim, Ylim, Zlim=NA, by=by, B=B,
alpha=alpha, parallel=FALSE)
plot(maxKDE)
Run the code above in your browser using DataLab