## Not run:
# # Generating a sample of size n=300 from the separated bimodal density of Marron and Wand (1992).
# w=c(0.5,0.5)
# mu=c(-3/2,3/2)
# sdev=c(1/2,1/2)
# dat=mixnorm(300,w,mu,sdev) # generated data vector
# arg=seq(-4,4,len=1000) # argument
# f=w[1]*dnorm(arg,mu[1],sd=sdev[1])+w[2]*dnorm(arg,mu[2],sd=sdev[2]) # true density
# dev.new()
# hist(dat,freq=F,ylab="",main="",cex.lab=1.7,cex.axis=1.7,xlim=c(-4,4),lwd=2,ylim=c(0,0.45),
# col='grey')
# title(main="Separated bimodal density",cex.main=1.7)
# legend(-5,0.4,legend="n=300",cex=2,bty="n")
# lines(arg,f,lwd=3,'l')
# ## End(Not run)
Run the code above in your browser using DataLab