## Not run: ------------------------------------
# # The Old Faithful geyser data set "faithful" is used. The sample size n=272.
# # The OSCV curves based on the Gaussian kernel and the robust kernel H_I (with
# # alpha=16.8954588 and sigma=1.01) are plotted. The horizontal scales of the curves
# # are changed such that their global minimizers are to be used in computing the
# # Gaussian local linear estimates of the regression function.
# xdat=faithful[[2]] #waiting time
# ydat=faithful[[1]] #eruption duration
# barray=seq(0.5,10,len=250)
# C_gauss=C_smooth(1,1)
# OSCV_gauss=OSCV_reg(barray/C_gauss,xdat,ydat,0)
# h_gauss=round(h_OSCV_reg(xdat,ydat,0),digits=4)
# dev.new()
# plot(barray,OSCV_gauss,'l',lwd=3,cex.lab=1.7,cex.axis=1.7,xlab="h",ylab="OSCV criterion")
# title(main="OSCV based on the Gaussian kernel",cex.main=1.7)
# legend(2.5,0.25,legend=paste("h_min=",h_gauss),cex=2,bty="n")
# C_H_I=C_smooth(16.8954588,1.01)
# OSCV_H_I=OSCV_reg(barray/C_H_I,xdat,ydat,1)
# h_H_I=round(barray[which.min(OSCV_H_I)],digits=4)
# dev.new()
# plot(barray,OSCV_H_I,'l',lwd=3,cex.lab=1.7,cex.axis=1.7,xlab="h",ylab="OSCV criterion",
# ylim=c(0.15,0.5))
# title(main="OSCV based on the robust kernel H_I",cex.main=1.7)
# legend(2.5,0.4,legend=paste("h_min=",h_H_I),cex=2,bty="n")
## ---------------------------------------------
Run the code above in your browser using DataLab