Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

GetCrCovYZ

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

Functional Data Analysis and Empirical Dynamics

v0.5.6
BSD_3_clause + file LICENSE
Authors
Cody Carroll [aut, cre] (<https://orcid.org/0000-0003-3525-8653>), Alvaro Gajardo [aut], Yaqing Chen [aut], Xiongtao Dai [aut], Jianing Fan [aut], Pantelis Z. Hadjipantelis [aut], Kyunghee Han [aut], Hao Ji [aut], Shu-Chin Lin [ctb], Paromita Dubey [ctb], Hans-Georg Mueller [cph, ths, aut], Jane-Ling Wang [cph, ths, aut]
Initial release
2021-01-10,

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.