pflm.fpca.utils.get_fpca_phi#

get_fpca_phi(num_pcs: int, reg_grid: ndarray, reg_mu: ndarray, eig_lambda: ndarray, eig_vector: ndarray)[source][source]#

Build FPCA eigenvalues/eigenfunctions normalized on the grid.

Parameters:
num_pcsint

Number of components to return (first num_pcs).

reg_gridnp.ndarray of shape (nt,)

Grid points where eigenfunctions are sampled (monotonic).

reg_munp.ndarray of shape (nt,)

Mean values on reg_grid, used for sign alignment.

eig_lambdanp.ndarray of shape (k,)

Raw eigenvalues from the covariance decomposition.

eig_vectornp.ndarray of shape (nt, k)

Raw eigenvectors (columns) from the covariance decomposition.

Returns:
fpca_lambdanp.ndarray of shape (num_pcs,)

Grid-scaled eigenvalues (Riemann approximation).

fpca_phinp.ndarray of shape (nt, num_pcs)

Grid-normalized eigenfunctions with sign aligned to reg_mu.

Notes

  • Eigenvalues are scaled by the grid spacing; eigenvectors are normalized to unit L2 norm on reg_grid.

  • Signs are chosen so that <phi_j, reg_mu> >= 0 for each component.