Learn R Programming

funcharts (version 1.7.0)

plot.mFPCA: Plot the results of the Mixed Functional Principal Component Analysis (mFPCA)

Description

This function provides plots of the principal components of the mFPCA.

Usage

# S3 method for mFPCA
plot(x, ...)

Value

No return value, called for side effects.

Arguments

x

The output of mFPCA.

...

A variable type could be provided that can assume two values. If type="single", the principal components are plotted separately. If type="all", the principal components are plotted together.

Examples

Run this code
library(funcharts)

data <- simulate_data_FRTM(n_obs = 100)
X <- sapply(1:100, function(ii)
  data$x_true[[ii]])
x_fd <-
  fda::smooth.basis(y = X,
                    argvals =  data$grid,
                    fda::create.bspline.basis(c(0, 1), 30))$fd
H <- sapply(1:100, function(ii)
  data$h[[ii]])
h_fd <-
  fda::smooth.basis(y = H,
                    argvals =  data$grid,
                    fda::create.bspline.basis(c(0, 1), 30))$fd
mod_mFPCA <- mFPCA(x_fd, h_fd, ncom = "ptv", par_ncom = 0.95)
plot(mod_mFPCA)

Run the code above in your browser using DataLab