cv.growth {growthrate}R Documentation

cross validation error

Description

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].

Usage

	cv.growth(data, tobs, d, K, a, b, r) 

Arguments

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 time-grid (between the first and last observation times in tobs) at which the posterior means and covariances are computed.

K

Number of points on the grid for sigma.

a

Minimum value for sigma (positive).

b

Maximum value for sigma (strictly larger than a).

r

Index of the interior observation time in tobs removed in the cross-validation.

Details

The data for the rth 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.

Value

sigmavec

K-vector of sigma-values considered in the cross validation.

CVer

Cross validation error at each value of sigma in sigmavec.

Author(s)

Sara Lopez-Pintado and Ian W. McKeague

Maintainer: Ian W. McKeague <im2131@columbia.edu>

References

Lopez-Pintado, S. and McKeague, I. W. (2013). Recovering gradients from sparsely observed functional data. Biometrics 69, 396-404 (2013). http://www.columbia.edu/~im2131/ps/growthrate-package-reference.pdf

Examples

## Not run: 
    ## example using the height data provided in the package
    ## there are 7 observation times (age in years):
    ## WARNING: cv.growth is time-consuming. 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)

[Package growthrate version 1.3 Index]