data(tecator)
x<-tecator$absorp.fdata
y=tecator$y$Fat
tt=x[["argvals"]]
a=seq(21,77,by=8)
b=seq(5,17,by=4)
l=2^(-4:15)
res1=fregre.basis.cv(x,y)
summary(res1)
res2=fregre.basis.cv(x,y,a,b,lambda=l,type.CV=GCV.S,par.CV=list(trim=0.05))
ind=c(7,8,9,13,14)
rbind(c(res1[ind],res1$basis.x.opt$type,res1$basis.x.opt$nbasis,
res1$basis.x.opt$type,res1$basis.b.opt$nbasis),
c(res2[ind],res2$basis.x.opt$type,res2$basis.x.opt$nbasis,res2$basis.x.opt$type
,res2$basis.b.opt$nbasis))Run the code above in your browser using DataLab