powered by
Function used to simulate sample sparse and irregular longitudinal data
datagen(ntotal,ntest,t_all,t_split,seed)
A list containing two elements
A long format data matrix containing one functional response (yy) and two functional predictors (xx,zz) with (ntotal-ntest) subjects
A long format data matrix containing one functional response (yy) and two functional predictors (xx,zz) with (ntest) subjects
Number of total longitudinal subjects
Number of total longitudinal subjects in the testing set
Vector of discrete measurement time (i.e 1,2,3,4,...)
A measurement time where the longitudinal response is of interest to predict after this t_split
Seed to derive replicable data
data = datagen(ntotal=350,ntest=50,t_all=1:50,t_split=25,seed=1) data$test data$train
Run the code above in your browser using DataLab