calcMFPCA: Internal function that implements the MFPCA algorithm for...

View source: R/MFPCA_calculation.R

calcMFPCAR Documentation

Internal function that implements the MFPCA algorithm for given univariate decompositions

Description

Internal function that implements the MFPCA algorithm for given univariate decompositions

Usage

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.

Value

A list containing the following components:

values

A vector of estimated eigenvalues \hat ν_1 , … , \hat ν_M.

functions

A multiFunData object containing the estimated multivariate functional principal components \hat ψ_1, …, \hat ψ_M.

scores

A matrix of dimension N x M containing the estimated scores \hat ρ_{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.


MFPCA documentation built on Sept. 15, 2022, 9:07 a.m.