2
$\begingroup$

Is functional principal-component analysis (FPCA) just an ordinary PCA on the coefficients of the orthonormal basis? The following seems to indicate that it is.

First, let's do an FPCA on the Canadian weather data:

import numpy as np
import skfda as fda
from skfda.preprocessing.dim_reduction import FPCA
from sklearn.decomposition import PCA

# get Canadian weather data
weather = fda.datasets.fetch_weather()
weather_data_grid = fda.FDataGrid(data_matrix = weather.data.data_matrix[:, :, 0],
                                  grid_points = weather.data.grid_points,
                                  domain_range = weather.data.domain_range)
# do an FPCA
weather_basis = fda.representation.basis.FourierBasis(domain_range = (0.0, 365.0),
                                                      n_basis = 25, period = 365)
weather_data_basis = weather_data_grid.to_basis(weather_basis)
weather_fpca = FPCA(n_components = 25)
weather_fpca.fit(weather_data_basis)

Now take the basis coefficients and do a regular old PCA on them:

pca = PCA(n_components = 25)
pca.fit(weather_data_basis.coefficients)

And compare the results:

np.allclose(weather_fpca.explained_variance_ratio_, pca.explained_variance_ratio_)
np.allclose(weather_fpca.components_.coefficients, pca.components_)

Both comparisons are true.

If an FPCA is just a PCA on basis coefficients, or am I missing something?

$\endgroup$

1 Answer 1

0
$\begingroup$

You are not far off; somewhat simplistically, yes, if we have dense, regularly-sampled smooth data as in the case of the Canadian weather dataset example, FPCA and PCA will coincide.

If we have sparse data (i.e. we have an irregularly sampled grid with a potentially variable amount of measurements per unit of analysis), then it is not the same as we will need to estimate the underlying covariance first and decompose it accordingly. Check Estimating Derivatives for Samples of Sparsely Observed Functions, With Application to Online Auction Dynamics by Liu & Müller for more details on the matter. The CV.SE thread on: Functional principal component analysis (FPCA): what is it all about? is also very helpful.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.