fregre.pc.cv(fdataobj,y,kmax=8,criteria="SIC",...)fdata class object.n.fregre.pcpc.opt principal components.pc.opt principal components in each iteration.pc.opt principal components.kmax is:
1.-Calculate the best principal component (pc.order[1]) between kmax first.
2.-Calculate the second-best principal component (pc.order [2]) between the (kmax-1) and calculate the criteria value of the two principal components.
3.-The process (point 1 and 2) is repeated until kmax principal component (pc.order[kmax]).
The method select the principal components (pc.opt=pc.order[1:k.min]) with minimum MSC criteria.
4.-Finally, is computing functional regression between functional explanatory variable and scalar response using the best selection of Principal Components, for more details see fregre.pc.fregre.pc, summary.fregre.fd and predict.fregre.fd.
Alternative method: fregre.basis.cv and fregre.np.cv.data(tecator)
absorp=tecator$absorp.fdata
ind=1:129
x=absorp[ind,]
y=tecator$y$Fat[ind]
out=fregre.pc.cv(x,y,7,"SICc")
out$pc.opt
summary(out$fregre.pc)Run the code above in your browser using DataLab