data(tecator)
x=tecator$absorp.fdata[1:129]
y=tecator$y$Fat[1:129]
nb<-100
## Time-consuming
# res.pc=fregre.pc(x,y,1:6)
# res.boot1=fregre.bootstrap(res.pc,nb=nb,wild=FALSE,kmax.fix=TRUE)
## predicted responses by bootstrap with FPC and FPLS basis
# newx=tecator$absorp.fdata[-c(1:129)]
# newy=tecator$y$Fat[-c(1:129)]
# res.pls=fregre.pls(x,y)
# res.boot2=fregre.bootstrap(res.pls,nb=nb,wild=FALSE,newX=newx,kmax.fix=TRUE)
# res.boot3=fregre.bootstrap(res.pc,nb=nb,wild=FALSE,newX=newx,kmax.fix=TRUE)
Run the code above in your browser using DataLab