pub fn peak_persistence(
data: &FdMatrix,
argvals: &[f64],
lambdas: &[f64],
max_iter: usize,
tol: f64,
) -> Result<PersistenceDiagramResult, FdarError>Expand description
Analyse the stability of peak count in the Karcher mean across a sweep of alignment penalty values.
For each candidate lambda the Karcher mean is computed and its peaks are counted. The longest interval of constant peak count is identified as the most stable configuration, and the midpoint lambda of that interval is returned as the optimal choice.
§Arguments
data- Functional data matrix (n x m).argvals- Evaluation grid (length m).lambdas- Candidate lambda values to sweep (must be non-empty, all >= 0).max_iter- Maximum Karcher iterations per lambda.tol- Karcher convergence tolerance.
§Errors
Returns FdarError::InvalidDimension if data has fewer than 2 rows or
argvals length mismatches.
Returns FdarError::InvalidParameter if lambdas is empty, any lambda
is negative, or max_iter is 0.