Description Usage Arguments Details Value Author(s) References Examples
Computes the cross validation error resulting from the removal of the data at a given interior observation time as a function of the infinitessimal standard deviation sigma
on a grid of k
equispaced values in the interval [a
, b
].
1 
data 
Input matrix of size N (subjects) times n (observation times). Each column contains the heights (of all subjects) at a given observation time, each row contains the heights (at the observation times) for a given subject. 
tobs 
Row vector of n observation times (in increasing order, same for each subject). 
d 
Number of points on the fine timegrid (between the first and last observation times in 
K 
Number of points on the grid for 
a 
Minimum value for 
b 
Maximum value for 
r 
Index of the interior observation time in 
The data for the r
th observation time (for a given 1 < r
< n) are removed and the mean squared error of the reconstructed data at that time point computed over the grid for sigma
.
sigmavec 

CVer 
Cross validation error at each value of 
Sara LopezPintado and Ian W. McKeague
Maintainer: Ian W. McKeague <[email protected]>
LopezPintado, S. and McKeague, I. W. (2013). Recovering gradients from sparsely observed functional data. Biometrics 69, 396404 (2013). http://www.columbia.edu/~im2131/ps/growthratepackagereference.pdf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  ## Not run:
## example using the height data provided in the package
## there are 7 observation times (age in years):
## WARNING: cv.growth is timeconsuming. This example uses only part of the data.
data(height_data);
ht = height_data[1:100,];
tobs=c(0,1/3,2/3,1,3,4,7);
cvg=cv.growth(ht, tobs, 100, 21, 1, 5, 2);
## Plot of the cross validation error as a function of sigma:
plot(cvg$sigmavec, cvg$CVer, xlab="Sigma", ylab="Cross validation error");
## Value of sigma that minimizes the cross validation error:
sigmaopt=cvg$sigmavec[which(cvg$CVer==min(cvg$CVer))];
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.