Skip to main content

dpca

Function dpca 

Source
pub fn dpca(
    data: &FdMatrix,
    argvals: &[f64],
    ncomp: usize,
    bandwidth: Option<usize>,
    filter_lag: Option<usize>,
) -> Result<DpcaResult, FdarError>
Expand description

Compute dynamic functional PCA (DPCA) from the spectral density operator.

Eigendecomposes the (Simpson-metric-scaled) spectral density operator at each Fourier frequency, sign-aligns the eigenvectors across frequencies, and inverse-FFTs each eigenvector trajectory into real time-domain filter taps over the symmetric lag window [-L, L]. Dynamic scores are the Simpson-weighted time-domain convolution of the curve series with the filters, over the valid interior t ∈ [L, N-1-L].

§Arguments

  • dataN × m functional time series.
  • argvals — grid points, length m.
  • ncomp — number of dynamic components (1..=m).
  • bandwidth — Bartlett bandwidth forwarded to spectral_density.
  • filter_lag — symmetric filter half-width L; None uses the resolved bandwidth. Must satisfy L < N/2.

§Errors

FdarError::InvalidParameter if ncomp is not in 1..=m or filter_lag is >= N/2; propagates spectral_density validation errors.