## Not run: ------------------------------------
# # Example (simulated data).
# n=200
# dx=(1:n-0.5)/n
# regf=2*dx^10*(1-dx)^2+dx^2*(1-dx)^10
# u=seq(0,1,len=1000)
# ydat=regf+rnorm(n,sd=0.002)
# dev.new()
# plot(dx,regf,'l',lty="dashed",lwd=3,xlim=c(0,1),ylim=c(1.1*min(ydat),1.1*max(ydat)),
# cex.axis=1.7,cex.lab=1.7)
# title(main="Function, generated data, and LLE",cex.main=1.5)
# points(dx,ydat,pch=20,cex=1.5)
# lines(u,loclin(u,dx,ydat,0.05),lwd=3,col="blue")
# legend(0,1.1*max(ydat),legend=c("LLE based on h=0.05","true regression function"),
# lwd=c(2,3),lty=c("solid","dashed"),col=c("blue","black"),cex=1.5,bty="n")
# legend(0.7,0.5*min(ydat),legend="n=200",cex=1.7,bty="n")
## ---------------------------------------------
Run the code above in your browser using DataLab