fdarep: Two-Dimensional FPCA, Marginal FPCA, and Product FPCA for Repeated Functional Data

Poorbita Kundu, Changbo Zhu, Kehui Chen, Pedro Delicado, Su I Iao, Zhou Hang, Han Chen, Muqing Cui, Hans-Georg MüllerOpenalex Unknown 2024 · DOI · OpenAlex

Abstract: The fdarep package provides a specialized implementation of two-dimensional functional principal component analysis (FPCA), Marginal FPCA, and Product FPCA specifically tailored for repeated functional data. These methods are implemented for both dense and sparsely observed functional data, addressing the complexities of hierarchical variation and irregular sampling. References: Chen, K., Delicado, P., & Müller, H. G. (2017); Chen, K., & Müller, H. G. (2012); Hall, P., Müller, H.G. and Wang, J.L. (2006); Yao, F., Müller, H. G., & Wang, J. L. (2005).

Introduction: The Challenge of Repeated Functional Data

Standard Functional Data Analysis (FDA) typically focuses on a single curve per subject. However, many modern datasets are "repeated"—think of a patient’s heart rate monitored every day for a month, or annual fertility rates recorded over decades. This creates a two-dimensional structure: variation happens both within a single curve (e.g., time of day) and across the repetitions (e.g., across different years).

The challenge lies in effectively capturing the covariance structure of this multi-level data. Furthermore, real-world data is rarely perfect; it is often "sparse," meaning observations are recorded at irregular intervals or have missing values. The fdarep package addresses the need for robust, computationally efficient implementations of statistical frameworks—specifically those developed by Chen, Müller, and others—to analyze these complex data structures.

Methodological Framework

The fdarep package implements three primary flavors of FPCA designed for repeated data, leveraging Rcpp for performance and fdapace for core calculations:

  1. Two-Dimensional FPCA (Dense2dFPCA): Treats the repeated functional data as a bivariate surface. It estimates a bivariate mean function and uses 2D eigenfunctions to capture the joint variation across both dimensions.
  2. Marginal FPCA (DenseMarginalFPCA, SparseMarginalFPCA): Decomposes the variation into marginal components. It looks at the "age" dimension (within-curve) and the "year" dimension (across-repetitions) to identify the primary modes of variation in each direction.
  3. Product FPCA (DenseProductFPCA, SparseProductFPCA): Models the eigenfunctions as products of marginal eigenfunctions. This approach is often more interpretable and computationally efficient than full 2D FPCA, especially for sparse data.
Output components for Marginal and Product FPCA, showing dimension-specific eigenfunctions.

A key contribution of this implementation is its flexibility: it handles both dense data (observed on a regular grid) and sparse data (where observations are scattered), using 5-fold cross-validation for automated bandwidth selection in the sparse case.

Key Results and Implementation

The "results" of this work are functional software tools that provide comprehensive statistical outputs for repeated data analysis. Key outputs include:

  • Bivariate Mean Estimation (mu): Accurate estimation of the average surface across all subjects and repetitions.
  • Eigenfunction Decomposition (eig): Extraction of product eigenfunctions. In Marginal/Product FPCA, these are further decomposed into phi (year-dimension) and psi (age-dimension) eigenfunctions.
  • FVE (Fraction of Variance Explained): Quantitative measures of how much total variation is captured by each principal component, allowing for informed model truncation.
  • Score Estimation (scores): Calculation of subject-specific "scores" that can be used in downstream tasks like clustering, regression, or classification.
Key output parameters for 2D FPCA implementation.

Discussion and Limitations

While fdarep provides a powerful suite of tools, several considerations remain for practitioners:

  • Computational Complexity: 2D FPCA can become computationally expensive as the number of grid points in both dimensions increases, as it involves large covariance matrices.
  • Assumption of Separability: Product FPCA assumes a degree of separability between the two dimensions. If the interaction between the "age" and "year" dimensions is highly non-linear and complex, a full 2D approach may be required.
  • Regularity Requirements: While the "Sparse" functions handle irregular sampling, they still generally benefit from a "common grid" in the age dimension for certain implementations.

Overall, fdarep fills a critical gap in the FDA ecosystem by providing specialized methods for hierarchical functional data structures, making advanced statistical methods accessible to researchers working with repeated measurements.

Summary updated

Abstract

Provides an implementation of two-dimensional functional principal component analysis (FPCA), Marginal FPCA, and Product FPCA for repeated functional data. Marginal and Product FPCA implementations are done for both dense and sparsely observed functional data. References: Chen, K., Delicado, P., &amp; Müller, H. G. (2017) &lt;<a href="https://doi.org/10.1111%2Frssb.12160" target="_top">doi:10.1111/rssb.12160</a>&gt;. Chen, K., &amp; Müller, H. G. (2012) &lt;<a href="https://doi.org/10.1080%2F01621459.2012.734196" target="_top">doi:10.1080/01621459.2012.734196</a>&gt;. Hall, P., Müller, H.G. and Wang, J.L. (2006) &lt;<a href="https://doi.org/10.1214%2F009053606000000272" target="_top">doi:10.1214/009053606000000272</a>&gt;. Yao, F., Müller, H. G., &amp; Wang, J. L. (2005) &lt;<a href="https://doi.org/10.1198%2F016214504000001745" target="_top">doi:10.1198/016214504000001745</a>&gt;.
BibTeX
@inproceedings{kundu2024fdarep,
  author = {Poorbita Kundu and Changbo Zhu and Kehui Chen and Pedro Delicado and Su I Iao and Zhou Hang and Han Chen and Muqing Cui and Hans-Georg Müller},
  title = {{fdarep: Two-Dimensional FPCA, Marginal FPCA, and Product FPCA for Repeated Functional Data}},
  booktitle = {Openalex Unknown},
  year = {2024},
  doi = {10.32614/cran.package.fdarep},
}
Figure