plot.MFPCAfit: Plot MFPCA results

View source: R/MFPCAfit_methods.R

plot.MFPCAfitR Documentation

Plot MFPCA results

Description

Plots the eigenfunctions as perturbations of the mean (i.e. the mean function plus/minus a constant factor times each eigenfunction separately). If all elements have a one-dimensional domain, the plots can be combined, otherwise the effects of adding and subtracting are shown in two separate rows for each eigenfunction.

Usage

## S3 method for class 'MFPCAfit'
plot(
  x,
  plotPCs = seq_len(nObs(x$functions)),
  stretchFactor = NULL,
  combined = FALSE,
  ...
)

Arguments

x

An object of class MFPCAfit, typically returned by the MFPCA function.

plotPCs

The principal components to be plotted. Defaults to all components in the MFPCAfit object.

stretchFactor

The factor by which the principal components are multiplied before adding / subtracting them from the mean function. If NULL (the default), the median absolute value of the scores of each eigenfunction is used.

combined

Logical: Should the plots be combined? (Works only if all dimensions are one-dimensional). Defaults to FALSE.

...

Further graphical parameters passed to the plot.funData functions for functional data.

Value

A plot of the principal components as perturbations of the mean.

See Also

MFPCA, plot.funData

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")))

# Plot the results
plot(PCA, combined = TRUE) # combine addition and subtraction in one plot

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