pub fn normalize(data: &FdMatrix, method: NormalizationMethod) -> FdMatrixExpand description
Normalize functional data using the specified method.
Column-wise methods (across curves at each time point):
Center: subtract column means (same ascenter_1d)Autoscale: center + divide by column std dev (unit variance per time point)Pareto: center + divide by sqrt(column std dev)Range: center + divide by column range (max - min)
Row-wise methods (per curve):
CurveCenter: subtract each curve’s own meanCurveStandardize: subtract mean, divide by std dev per curveCurveRange: scale each curve to [0, 1]CurveLp(p): divide each curve by its Lp norm — requiresargvals, usenormalize_with_argvalsinstead
§Panics
Panics if CurveLp is used without argvals. Use normalize_with_argvals
for Lp normalization.
§Examples
use fdars_core::matrix::FdMatrix;
use fdars_core::fdata::{normalize, NormalizationMethod};
let data = FdMatrix::from_column_major(
vec![1.0, 3.0, 2.0, 6.0, 3.0, 9.0], 2, 3,
).unwrap();
// Autoscale: zero mean, unit variance per time point
let scaled = normalize(&data, NormalizationMethod::Autoscale);
assert_eq!(scaled.shape(), (2, 3));