predict.MFPCAfit function

Function prediction based on MFPCA results

Function prediction based on MFPCA results

Predict functions based on a truncated multivariate Karhunen-Loeve representation: [REMOVE_ME]x^=m^u+m=1Mρmψ^m[REMOVEME2] \hat x = \hat mu + \sum_{m = 1}^M \rho_m \hat \psi_m [REMOVE_ME_2]

with estimated mean function μ^\hat \mu and principal components ψm\psi_m. The scores ρm\rho_m can be either estimated (reconstruction of observed functions) or user-defined (construction of new functions).

## S3 method for class 'MFPCAfit' predict(object, scores = object$scores, ...)

Arguments

  • object: An object of class MFPCAfit, typically resulting from a MFPCA function call.
  • scores: A matrix containing the score values. The number of columns in scores must equal the number of principal components in object. Each row represents one curve. Defaults to the estimated scores in object, which yields reconstructions of the original data used for the MFPCA calculation.
  • ...: Arguments passed to or from other methods.

Returns

A multiFunData object containing the predicted functions.

Description

Predict functions based on a truncated multivariate Karhunen-Loeve representation:

x^=m^u+m=1Mρmψ^m \hat x = \hat mu + \sum_{m = 1}^M \rho_m \hat \psi_m

with estimated mean function μ^\hat \mu and principal components ψm\psi_m. The scores ρm\rho_m can be either estimated (reconstruction of observed functions) or user-defined (construction of new functions).

Examples

#' # Simulate multivariate functional data on one-dimensonal domains # and calculate MFPCA (cf. MFPCA help) set.seed(1) # simulate data (one-dimensional domains) sim <- simMultiFunData(type = "split", argvals = list(seq(0,1,0.01), seq(-0.5,0.5,0.02)), M = 5, eFunType = "Poly", eValType = "linear", N = 100) # MFPCA based on univariate FPCA PCA <- MFPCA(sim$simData, M = 5, uniExpansions = list(list(type = "uFPCA"), list(type = "uFPCA"))) # Reconstruct the original data pred <- predict(PCA) # default reconstructs data used for the MFPCA fit # plot the results: 1st element plot(sim$simData[[1]]) # original data plot(pred[[1]], add = TRUE, lty = 2) # reconstruction # plot the results: 2nd element plot(sim$simData[[2]]) # original data plot(pred[[2]], add = TRUE, lty = 2) # reconstruction

See Also

MFPCA