Multivariate Functional Principal Component Analysis for Data Observed on Different Dimensional Domains

Calculate a multivariate functional principal component analysis for data observed on different dimensional domains. The estimation algorithm relies on univariate basis expansions for each element of the multivariate functional data (Happ & Greven, 2018) . Multivariate and univariate functional data objects are represented by S4 classes for this type of data implemented in the package 'funData'. For more details on the general concepts of both packages and a case study, see Happ-Kurz (2020) .

Travis-CI Build Status AppVeyor Build Status CRAN_Status_Badge Coverage Status

MFPCA is an R-package for calculating a PCA for multivariate functional data observed on different domains, that may also differ in dimension. The estimation algorithm relies on univariate basis expansions for each element of the multivariate functional data.


MFPCA allows to calculate a principal component analysis for multivariate (i.e. combined) functional data on up to three-dimensional domains:

  • Standard functional data defined on a (one-dimensional) interval.
  • Functional data with two-dimensional domains (images).
  • Functional data with three-dimensional domains (3D images, e.g. brain scans).

It implements various univariate bases:

  • Univariate functional PCA (only one-dimensional domains).
  • Spline bases (one- and two-dimensional domains; with optional smoothing penalty).
  • Cosine bases (two- and three-dimensional domains; fast implementation built on DCT).
  • Tensor PCA (two-dimensional domains; UMPCA approach from Lu et al. (2009) and FCP_TPA approach from Allen (2013)).
  • Given basis functions, e.g. from a previous univariate PCA.

The representation of the data is based on the object-oriented funData package, hence all functionalities for plotting, arithmetics etc. included therein may be used.


The MFPCA pacakge is available on CRAN. To install the latest version directly from GitHub, please use devtools::install_github("ClaraHapp/MFPCA") (install devtools before).

If you would like to use the cosine bases make sure that the C-library fftw3 is installed on your computer before you install MFPCA. Otherwise, MFPCA is installed without the cosine bases and will throw an error if you attempt to use functions that need fftw3.


The MFPCA package depends on the R-package funData for representing (multivariate) functional data. It uses functionalities from abind, foreach, irlba, Matrix, mgcv and plyr.


The theoretical foundations of multivariate functional principal component analysis are described in:

C. Happ, S. Greven (2018): Multivariate Functional Principal Component Analysis for Data Observed on Different (Dimensional) Domains. Journal of the American Statistical Association, 113(522): 649-659 .

Bug reports

Please use GitHub issues for reporting bugs or issues.


MFPCA 1.3-1

New features

  • Consequent use of seq_len(x) instead of 1:x.
  • Use of type-safe vapply instead of sapply, where applicable.


New features

  • New univariate expansion type fda, which allows to use all basis functions implemented in package fda.
  • Correct typos in documentation.
  • Theoretical paper is now finally published.

MFPCA 1.2-3

New features

  • Skip third party tests on CRAN that lead to ATLAS/MKL/OpenBLAS issues. Add warning to documentation files.

MFPCA 1.2-2

New features

  • Function screeplot for MFPCAfitobjects now with integers only on x-axis and optional parameter ylim.
  • Separate print function for objects of class summary.MFPCAfit.
  • Configure-file now with correct version number.
  • Links to MFPCA paper and software paper in DESCRIPTION file, as well as to ORCID.

MFPCA 1.2-1

New features

  • Tolerance for splineFunction2Dpen unit tests reduced due to ATLAS/OpenBLAS/MKL issues.


New features

  • The main MFPCA method now returns an object of class MFPCAfit for which new functions (plot, predict, summary, ...) have been implemented. The methods can use namesof functional data objects (requires funData 1.2).
  • It is now possible to pass a given basis decomposition for elements (e.g. from previous PCA).
  • Univariate decompositions (xxxBasis) and expansions (xxxFunction) are not exported any more, but should be accessed using the univDecomp and univExpansion meta-functions.
  • New function multivExpansion to calculate a multivariate basis expansion.
  • More argument checking for user-facing functions including unit tests.
  • Tolerance for regression tests reduced to 1e-5.
  • References have been updated.


New features

  • New parameter bootstrapStrat in MFPCA main function enables stratified bootstrap. Bootstrap CIs for eigenvalues are returned, too.
  • MFPCA function now returns the eigenvectors and normFactors that are calculated within the MFPCA calculation. They can be used to calculate out-of-sample predictions.
  • fcptpaBasis now returns eigenvalues and has new option to normalize the eigenfunctions.
  • Unit test coverage has been increased to almost 100%.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.3-9 by Clara Happ-Kurz, a month ago

Browse source code at

Authors: Clara Happ-Kurz [aut, cre]

Documentation:   PDF Manual  

Task views: Functional Data Analysis

GPL-2 license

Imports abind, foreach, irlba, Matrix, methods, mgcv, plyr, stats

Depends on funData

Suggests covr, fda, testthat

System requirements: libfftw3 (>= 3.3.4)

Imported by FADPclust, multifamm.

See at CRAN