###generate data
x <- rnorm(100, 10, 1.5)
##calcualte bandwidth by normal refernce rule
bw1 <- BW.ref(x=x, method="KS")
##calcualte bandwidth by Sheather-Jones plug-in method
bw2 <- BW.ref(x=x, method="KS-SJ")
Run the code above in your browser using DataLab