# NOT RUN {
data(simdat)
## plot x vs y with f(x) and f(x) +/- 2s(x) for train and test simulated data
##train
plot(simdat$x,simdat$y,xlab="x",ylab="y")
##test
points(simdat$xp,simdat$yp,col="red",pch=2)
lines(simdat$xp,simdat$fxp,col="blue",lwd=2)
lines(simdat$xp,simdat$fxp+2*simdat$sxp,col="blue",lwd=2,lty=2)
lines(simdat$xp,simdat$fxp-2*simdat$sxp,col="blue",lwd=2,lty=2)
legend("topleft",legend=c("train","test"),pch=c(1,2),col=c("black","red"))
# }
Run the code above in your browser using DataLab