t_all = 1:50
data = datagen(ntotal=350,ntest=50,t_all=t_all,t_split=25,seed=1)
data.sample = data$test[,c(1,2,3)]
# In this case, num.t=50 and num.sub=50 since we only used 50 subjects in the testing data
data.FPCA = FPCA_trajectory(data.sample,list(dataType='Sparse',
error=FALSE, kernel='gauss', verbose=FALSE, nRegGrid=length(t_all)))
data.FPCA$target_fit
Run the code above in your browser using DataLab