pub fn align_to_target(
data: &FdMatrix,
target: &[f64],
argvals: &[f64],
lambda: f64,
) -> AlignmentSetResultExpand description
Align all curves in data to a single target curve.
§Arguments
data— Functional data matrix (n × m)target— Target curve to align to (length m)argvals— Evaluation points (length m)lambda— Penalty weight on warp deviation from identity (0.0 = no penalty)
§Returns
AlignmentSetResult with all warping functions, aligned curves, and distances.
§Examples
use fdars_core::matrix::FdMatrix;
use fdars_core::alignment::align_to_target;
let argvals: Vec<f64> = (0..20).map(|i| i as f64 / 19.0).collect();
let target: Vec<f64> = argvals.iter().map(|&t| (t * 6.0).sin()).collect();
let data = FdMatrix::from_column_major(
(0..60).map(|i| ((i as f64 * 0.05) + 0.1).sin()).collect(),
3, 20,
).unwrap();
let result = align_to_target(&data, &target, &argvals, 0.0);
assert_eq!(result.aligned_data.shape(), (3, 20));
assert_eq!(result.distances.len(), 3);