n <- 250
mu <- 2 # Mean
y <- sort(rpois(n, mu))
# kernel support parameter
k <- 1
H <- seq((max(y) - min(y)) / 200, (max(y) - min(y)) / 2, length.out = 50)
hcv <- cv_bandwidth(kernel = "optimal", y, h = H, k = k)
Run the code above in your browser using DataLab