GetCrCovYZ: Functional Cross Covariance between longitudinal variable Y...

View source: R/GetCrCovYZ.R

GetCrCovYZR Documentation

Functional Cross Covariance between longitudinal variable Y and scalar variable Z

Description

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

Usage

GetCrCovYZ(
  bw = NULL,
  Z,
  Zmu = NULL,
  Ly,
  Lt = NULL,
  Ymu = NULL,
  support = NULL,
  kern = "gauss"
)

Arguments

bw

Scalar bandwidth for smoothing the cross-covariance function (if NULL it will be automatically estimated)

Z

Vector N-1 Vector of length N with the scalar function values

Zmu

Scalar with the mean of Z (if NULL it will be automatically estimated)

Ly

List of N vectors with amplitude information

Lt

List of N vectors with timing information

Ymu

Vector Q-1 Vector of length nObsGrid containing the mean function estimate

support

Vector of unique and sorted values for the support of the smoothed cross-covariance function (if NULL it will be automatically estimated)

kern

Kernel type to be used. See ?FPCA for more details. (default: 'gauss') If the variables Ly1 is in matrix form the data are assumed dense and only the raw cross-covariance is returned. One can obtain Ymu1 from FPCA and ConvertSupport.

Value

A list containing:

smoothedCC

The smoothed cross-covariance as a vector

rawCC

The raw cross-covariance as a vector

bw

The bandwidth used for smoothing as a scalar

score

The GCV score associated with the scalar used

References

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

Examples

Ly <- list( runif(5),  c(1:3), c(2:4), c(4))
Lt <- list( c(1:5), c(1:3), c(1:3), 4)
Z = rep(4,4) # Constant vector so the covariance has to be zero.
sccObj = GetCrCovYZ(bw=1, Z= Z, Ly=Ly, Lt=Lt, Ymu=rep(4,5))

fdapace documentation built on July 3, 2024, 5:08 p.m.