Learn R Programming

fdapace (version 0.1.1)

GetCrCovYX: Functional Cross Covariance between longitudinal variable Y and longitudinal variable X

Description

Calculate the raw and the smoothed cross-covariance between functional predictors using bandwidth bw or estimate that bw using GCV.

Usage

GetCrCovYX(bw1 = NULL, bw2 = NULL, Ly1, Lt1 = NULL, Ymu1 = NULL, Ly2,
  Lt2 = NULL, Ymu2 = NULL, useGAM = FALSE)

Arguments

bw1
Scalar bandwidth for smoothing the cross-covariance function (if NULL it will be automatically estimated) (Y)
bw2
Scalar bandwidth for smoothing the cross-covariance function (if NULL it will be automatically estimated) (X)
Ly1
List of N vectors with amplitude information (Y)
Lt1
List of N vectors with timing information (Y)
Ymu1
Vector Q-1 Vector of length nObsGrid containing the mean function estimate (You can get that from FPCA) (Y)
Ly2
List of N vectors with amplitude information (X)
Lt2
List of N vectors with timing information (X)
Ymu2
Vector Q-1 Vector of length nObsGrid containing the mean function estimate (You can get that from FPCA) (X)
useGAM
Indicator to use gam smoothing instead of local-linear smoothing (semi-parametric option) If the variables Ly1 and Ly2 are in matrix form the data are assumed dense and only the raw cross-covariance is returned.

Value

  • A list containing:
  • smoothedCCThe smoothed cross-covariance as a matrix (currently only 51 by 51)
  • rawCCThe raw cross-covariance as a list
  • bwThe bandwidth used for smoohting as a vector of lengh 2
  • scoreThe GCV score associated with the scalar used
  • smoothGridThe grid over which the smoothed cross-covariance is evaluated

References

Yang, Wenjing, Hans-Georg Mueller, and Ulrich Stadtmueller. "Functional singular component analysis." Journal of the Royal Statistical Society: Series B (Statistical Methodology) 73.3 (2011): 303-324

Examples

Run this code
Ly1= list( rep(2.1,7), rep(2.1,3),2.1 );
Lt1 = list(1:7,1:3, 1);
Ly2 = list( rep(1.1,7), rep(1.1,3),1.1); 
Lt2 = list(1:7,1:3, 1);
Ymu1 = rep(55,7);
Ymu2 = rep(1.1,7);
AA<-GetCrCovYX(Ly1 = Ly1, Ly2= Ly2, Lt1=Lt1, Lt2=Lt2, Ymu1=Ymu1, Ymu2=Ymu2)

Run the code above in your browser using DataLab