calcMFPCA function

Internal function that implements the MFPCA algorithm for given univariate decompositions

Internal function that implements the MFPCA algorithm for given univariate decompositions

calcMFPCA( N, p, Bchol, M, type, weights, npc, argvals, uniBasis, fit = FALSE, approx.eigen = FALSE )

Arguments

  • N: Number of observations.
  • p: Number of elements in multivariate functional data.
  • Bchol: Cholesky decomposition of B = block diagonal of Cholesky decompositions.
  • M: The number of multivariate functional principal components to calculate.
  • type: Vector of univariate decompositions to use.
  • weights: Vector of weights.
  • npc: Vector giving the number of univariate basis functions used.
  • argvals: List of argument values for each of the univariate basis functions.
  • uniBasis: List of univariate basis functions.
  • fit: Logical. If TRUE, a truncated multivariate Karhunen-Loeve representation for the data is calculated based on the estimated scores and eigenfunctions.
  • approx.eigen: Logical. If TRUE, the eigenanalysis problem for the estimated covariance matrix is solved approximately using the irlba package, which is much faster. If the number M of eigenvalues to calculate is high with respect to the number of observations in mFData or the number of estimated univariate eigenfunctions, the approximation may be inappropriate. In this case, approx.eigen is set to FALSE and the function throws a warning. Defaults to FALSE.

Returns

A list containing the following components: - values: A vector of estimated eigenvalues c("hatnu1\n\\hat \\nu_1\n", ",ldots,hatnuM , \\ldots , \\hat \\nu_M"). - functions: A multiFunData object containing the estimated multivariate functional principal components c("hatpsi1,ldots,hat\n\\hat \\psi_1, \\ldots, \\hat\n", "psiM \\psi_M"). - scores: A matrix of dimension N x M containing the estimated scores ρ^im\hat \rho_{im}. - vectors: A matrix representing the eigenvectors associated with the combined univariate score vectors. This might be helpful for calculating predictions.

  • normFactors: The normalizing factors used for calculating the multivariate eigenfunctions and scores. This might be helpful when calculation predictions. - meanFunction: A multivariate functional data object, corresponding to the mean function. The MFPCA is applied to the de-meaned functions in mFData.- fit: A multiFunData object containing estimated trajectories for each observation based on the truncated Karhunen-Loeve representation and the estimated scores and eigenfunctions.