getPCA function

Functional principal component analysis

Functional principal component analysis

This function is used to perform functional principal component analysis.

getPCA(data, nbasis, ncomp, gp, emodel = c("classical", "robust"))

Arguments

  • data: An n×pn \times p-dimensional data matrix for functional data X(s)X(s), where nn denotes the sample size and pp denotes the number of grid points for X(s)X(s).
  • nbasis: An integer specifying the number of B-spline basis expansion functions used to approximate the functional principal components.
  • ncomp: An integer specifying the number of functional principal components to be computed.
  • gp: A vector containing the grid points for the functional data for X(s)X(s).
  • emodel: Method to be used for functional principal component decomposition. Possibilities are "classical" and "robust".

Details

The functional principal decomposition of a functional data X(s)X(s) is given by

X(s)=Xˉ(s)+k=1Kξkψk(s), X(s) = \bar{X}(s) + \sum_{k=1}^K \xi_k \psi_k(s),

where Xˉ(s)\bar{X}(s) is the mean function, ψk(s)\psi_k(s) is the kk-th weight function, and ξk\xi_k is the corresponding principal component score which is given by

ξk=(X(s)Xˉ(s))ψk(s)ds. \xi_k = \int (X(s) - \bar{X}(s)) \psi_k(s) ds.

When computing the estimated functional principal components, first, the functional data is expressed by a set of B-spline basis expansion. Then, the functional principal components are equal to the principal components extracted from the matrix Dφ1/2D \varphi^{1/2}, where DD is the matrix of basis expansion coefficients and φ\varphi is the inner product matrix of the basis functions, i.e., φ=φ(s)φ(s)ds\varphi = \int \varphi(s) \varphi^\top(s) ds. Finally, the kk-th weight function is given by ψk(s)=φ1/2ak\psi_k(s) = \varphi^{-1/2} a_k, where aka_k is the kk-th eigenvector of the sample covariance matrix of Dφ1/2D \varphi^{1/2}.

If emodel = "classical", then, the standard functional principal component decomposition is used as given by Ramsay and Dalzell (1991).

If emodel = "robust", then, the robust principal component algorithm of Hubert, Rousseeuw and Verboven (2002) is used.

Returns

A list object with the following components: - PCAcoef: A functional data object for the eigenfunctions.

  • PCAscore: A matrix of principal component scores.

  • meanScore: A functional data object for the mean function.

  • bs_basis: A functional data object for B-spline basis expansion.

  • evalbase: A matrix of the B-spline basis expansion functions.

  • ncomp: An integer denoting the computed number of functional principal components. If the input ```ncomp'' is NULL, then, the output ncomp` equals to the number of functional principal components whose usage results in at least 95% explained variation.

  • gp: A vector containing the grid points for the functional data for X(s)X(s).

  • emodel: A character vector denoting the method used for functional principal component decomposition.

References

J. O. Ramsay and C. J. Dalzell (1991) "Some tools for functional data analysis (with discussion)", Journal of the Royal Statistical Society: Series B, 53 (3), 539-572.

M. Hubert and P. J. Rousseeuw and S. Verboven (2002) "A fast robust method for principal components with applications to chemometrics", Chemometrics and Intelligent Laboratory Systems, 60 (1-2), 101-111.

P. Filzmoser and H. Fritz and K Kalcher (2021) pcaPP: Robust PCA by Projection Pursuit, R package version 1.9-74, URL: https://cran.r-project.org/web/packages/pcaPP/index.html.

J. L. Bali and G. Boente and D. E. Tyler and J.-L. Wang (2011) "Robust functional principal components: A projection-pursuit approach", The Annals of Statistics, 39 (6), 2852-2882.

Author(s)

Ufuk Beyaztas and Han Lin Shang

Examples

sim.data <- generate.ff.data(n.pred = 5, n.curve = 200, n.gp = 101) Y <- sim.data$Y gpY <- seq(0, 1, length.out = 101) # grid points rob.fpca <- getPCA(data = Y, nbasis = 20, ncomp = 4, gp = gpY, emodel = "robust")
  • Maintainer: Ufuk Beyaztas
  • License: GPL-3
  • Last published: 2024-01-23

Useful links

    Downloads (last 30 days):