Computes either the scores of new observations on selected principal
components, or their reconstruction from the selected components,
given a PCA fitted by pca_mfd.
# S3 method for pca_mfd
predict(
object,
newdata = NULL,
components = seq_len(ncol(object$pcscores)),
type = c("scores", "reconstruction"),
...
)If type = "scores", a numeric matrix of dimension
\(nobs \times length(components)\).
If type = "reconstruction", an object of class "mfd".
An object of class "pca_mfd", typically the output of
pca_mfd.
An object of class "mfd" containing the new
multivariate functional data to be projected. If NULL, the training
data used to fit object are used.
Integer vector specifying the indices of the principal components to use. Defaults to all available components.
Character string: either "scores" (default) to return the
scores of newdata, or "reconstruction" to return the data
reconstructed from the selected components.
Further arguments passed to or from other methods (not used).
This function is an S3 method for objects of class "pca_mfd".
It is usually called via the generic predict function.
The new data are first centered and (optionally) scaled using the functional center and scale stored in the PCA object.
If type = "scores", inner products with the selected eigenfunctions
are computed and summed across basis functions.
If type = "reconstruction", the predicted functional data are
reconstructed from the scores and harmonics.
pca_mfd, scale_mfd