## Not run:
# # Example 1. MISE for the separated bimodal density of Marron and Wand (1992).
# # in the case (alpha,sigma)=(2.42,5.06), n=100.
# harray=seq(0.05,1,len=1000)
# w=c(1/2,1/2)
# m=c(-3/2,3/2)
# s=c(1/2,1/2)
# MISEarray=MISE_mixnorm(harray,100,2.42,5.06,w,m,s)
# hopt=round(optimize(MISE_mixnorm,c(0.01,1),n=100,alpha=2.42,sigma=5.06,w=w,mu=m,sdev=s)$minimum,
# digits=4)
# dev.new()
# plot(harray,MISEarray,'l',lwd=3,xlab="h",ylab="MISE",cex.lab=1.7,cex.axis=1.7,main="")
# title(main="MISE(h) for the separated bimodal density",cex.main=1.5)
# legend(0.45,0.45,legend=c(paste("h_MISE=",hopt),"n=100"),bty="n",cex=1.7)
#
# # Example 2. MISE for the N(0,1) density in the case of the Gaussian kernel and n=500.
# harray=seq(0.03,1,len=1000)
# MISEarray=MISE_mixnorm(harray,500,1,1,1,0,1)
# hopt=round(optimize(MISE_mixnorm,c(0.01,1),n=500,alpha=1,sigma=1,w=1,mu=0,sdev=1)$minimum,digits=4)
# dev.new()
# plot(harray,MISEarray,'l',lwd=3,xlab="h",ylab="MISE",cex.lab=1.7,cex.axis=1.7,main="")
# title(main="MISE(h) for the standard normal density",cex.main=1.7)
# legend(0.2,0.02,legend=c(paste("h_MISE=",hopt),"n=500"),bty="n",cex=1.7)
# ## End(Not run)
Run the code above in your browser using DataLab