## Not run: ------------------------------------
# dat_norm=rnorm(300) #generating random sample of size n=300 from the standard normal density.
# h_oscv=round(h_OSCV_dens(dat_norm,0),digits=4)
# y=density(dat_norm,bw=h_oscv)
# dev.new()
# plot(y,lwd=3,cex.lab=1.7,cex.axis=1.7,cex.main=1.7,xlab=paste("n=100, h_OSCV=",h_oscv),
# main="Standard normal density estimate by OSCV",ylim=c(0,0.45),xlim=c(-4.5,4.5))
# u=seq(-5,5,len=1000)
# lines(u,dnorm(u),lwd=3,lty="dashed",col="blue")
# legend(0.75,0.4,legend=c("OSCV estimate","N(0,1) density"),lwd=c(3,3),lty=c("solid","dashed"),
# col=c("black","blue"),bty="n",cex=1.25)
## ---------------------------------------------
Run the code above in your browser using DataLab