Covariance surface estimation for dense or sparse functional data.
GetCovSurface(Ly, Lt, optns = list())
A list containing the following fields:
A square matrix of size nWorkGrid containing the covariance surface estimate.
A numeric estimate of the variance of measurement error.
A vector of length nWorkGrid. The internal regular grid on which the covariance surface estimation is carried out.
The selected (or user specified) bandwidth for smoothing thecovariance surface.
A list of actually-used options relevant to the covariance surface calculation.
A list of n vectors containing the observed values for each individual. Missing values specified by NA
s are supported for dense case (dataType='Dense'
).
A list of n vectors containing the observation time points for each individual corresponding to y. Each vector should be sorted in ascending order.
A list of options control parameters specified by list(name=value)
. See `Details'.
Available control options are
The bandwidth value for the smoothed covariance function; positive numeric - default: determine automatically based on 'methodBwCov'
The bandwidth choice method for the smoothed covariance function; 'GMeanAndGCV' (the geometric mean of the GCV bandwidth and the minimum bandwidth),'CV','GCV' - default: 10% of the support
The bandwidth value for the smoothed mean function (using 'CV' or 'GCV'); positive numeric - default: determine automatically based on 'methodBwMu'
The bandwidth choice method for the mean function; 'GMeanAndGCV' (the geometric mean of the GCV bandwidth and the minimum bandwidth),'CV','GCV' - default: 5% of the support
The type of design we have (usually distinguishing between sparse or dense functional data); 'Sparse', 'Dense', 'DenseWithMV', 'p>>n' - default: determine automatically based on 'IsRegular'
Assume measurement error in the dataset; logical - default: TRUE
Smoothing kernel choice, common for mu and covariance; "rect", "gauss", "epan", "gausvar", "quar" - default: "gauss"; dense data are assumed noise-less so no smoothing is performed.
The number of folds to be used for mean and covariance smoothing. Default: 10
If TRUE the 'inputData' field in the output list is empty. Default: FALSE
The method to estimate the mean and covariance in the case of dense functional data; 'cross-sectional', 'smooth' - default: 'cross-sectional'
The number of support points in each direction of covariance surface; numeric - default: 51
The number of bins to bin the data into; positive integer > 10, default: NULL
The 2-element vector in [0,1] indicating the percent of data truncated during sigma^2 estimation; default (0.25, 0.75))
Should the data be binned? 'FORCE' (Enforce the # of bins), 'AUTO' (Select the # of bins automatically), 'OFF' (Do not bin) - default: 'AUTO'
Whether to use the binned raw covariance for smoothing; logical - default:TRUE
The user-defined smoothed mean function; list of two numerical vector 't' and 'mu' of equal size, 't' must cover the support defined 'Ly' - default: NULL
The user-defined measurement error variance. A positive scalar. If specified then no regularization is used (rho is set to 'no', unless specified otherwise). Default to `NULL`
Pick the largest bandwidth such that CV-error is within one Standard Error from the minimum CV-error, relevant only if methodBwMu ='CV' and/or methodBwCov ='CV'; logical - default: FALSE
set.seed(1)
n <- 20
pts <- seq(0, 1, by=0.025)
sampWiener <- Wiener(n, pts)
mu = sin(2*pi*pts)
sampWiener <- Sparsify(t(t(sampWiener) + mu), pts, 10)
res = GetCovSurface(Ly = sampWiener$Ly, Lt = sampWiener$Lt)
Run the code above in your browser using DataLab