Skip to main content

gauss_model

Function gauss_model 

Source
pub fn gauss_model(
    karcher: &KarcherMeanResult,
    argvals: &[f64],
    ncomp: usize,
    n_samples: usize,
    seed: u64,
) -> Result<GenerativeModelResult, FdarError>
Expand description

Generate random curves from a fitted Gaussian model on aligned data.

Samples amplitude and phase components independently from their respective FPCA score distributions (Gaussian with covariance = diag(eigenvalues)), then combines them to produce synthetic functional data.

§Arguments

  • karcher — Pre-computed Karcher mean result (with aligned data and gammas)
  • argvals — Evaluation points (length m)
  • ncomp — Number of principal components for both amplitude and phase
  • n_samples — Number of curves to generate
  • seed — RNG seed for reproducibility

§Errors

Returns FdarError::InvalidDimension if dimensions are inconsistent or FdarError::ComputationFailed if FPCA fails.