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?