Projecting new functional data using an existing FPCA analysis is very similar to what we would do with standard PCA (for multivariate data). The main difference is that due to stochastic nature of our sampling procedure we are unable to use standard numerical integration as we would in the case of PCA to get the corresponding score but rather a probabilistic approximation of it (PACE - see reference below).
For rest of the post I will refer to $\phi$ as the functional PCs, $\xi$ as the associated FPC scores, $\lambda$ as their associated eigenvalues, $\mu$ as the sample mean and $C$ as the sample covariance. I also assume we are dealing with irregularly spaced data across a continuum $s$ and I refer to the test data at hand as $y_{test}$.
In short, the prediction for the trajectory $y_i(s)$ using the first $K$ eigenfunctions is: $\hat{y}_i^K(s) = \hat{\mu}(s) + \sum_{k=1}^{K} \hat{\xi}_{i,k}\hat{\phi}_k(s)$.
In order to project new test data on the results of an existing FPCA we would require the following steps:
- Ensure that $\mu$, $C$ and $\phi$ are evaluated at the same points of $s$ we have $y_{test}$ readings. If necessary, we estimate these values through interpolation techniques.
- Centre the data to have $E\{\mu(s)\}=0$ according the $\hat\mu(s)$ we calculated during the original FPCA.
- Predict the $\xi$ for the test data, using the fact that we expect the error of the prediction to be asymptotically Gaussian, through: $\hat{\xi}_{ik} = \hat{\lambda}_k \hat{\phi}_{ik}^T\hat{\Sigma}^{-1}_{y_i}(y_i^{obs} - \hat{\mu}_i)$. Notice that all estimates (aside $\hat{\lambda}_k$) are evaluated at the points we have observations from the $i$-th curve, i.e. they might even be just scalar in the odd case a particular sample has a single measurement. This whole procedure is what in the FDA literature is referred as the "PACE step/procedure" (PACE: Principal components Analysis through Conditional Expectation); the canonical reference on the matter is: Yao, et al. (2005) Functional Data Analysis for Sparse Longitudinal Data (Sect. 2.3 to be exact).
The package fdapace
implements this methodology through the function predict.FPCA
. The package fda
(most probably) implements this methodology in the function project.basis
but I have not used it.