screeplot.MFPCAfit: Screeplot for Multivariate Functional Principal Component...

View source: R/MFPCAfit_methods.R

screeplot.MFPCAfitR Documentation

Screeplot for Multivariate Functional Principal Component Analysis

Description

This function plots the proportion of variance explained by the leading eigenvalues in an MFPCA against the number of the principal component.

Usage

## S3 method for class 'MFPCAfit'
screeplot(
  x,
  npcs = min(10, length(x$values)),
  type = "lines",
  ylim = NULL,
  main = deparse(substitute(x)),
  ...
)

Arguments

x

An object of class MFPCAfit, typically returned by a call to MFPCA.

npcs

The number of eigenvalued to be plotted. Defaults to all eigenvalues if their number is less or equal to 10, otherwise show only the leading first 10 eigenvalues.

type

The type of screeplot to be plotted. Can be either "lines" or "barplot". Defaults to "lines".

ylim

The limits for the y axis. Can be passed either as a vector of length 2 or as NULL (default). In the second case, ylim is set to (0,max(pve)), with pve the proportion of variance explained by the principal components to be plotted.

main

The title of the plot. Defaults to the variable name of x.

...

Other graphic parameters passed to plot.default (for type = "lines") or barplot (for type = "barplot").

Value

A screeplot, showing the decrease of the principal component score.

See Also

MFPCA, screeplot

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

# screeplot
screeplot(PCA) # default options
screeplot(PCA, npcs = 3, type = "barplot", main= "Screeplot")

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