pub fn derivative(x: &[f64], y: &[f64]) -> Vec<f64>Expand description
The derivative of y with respect to x, sample for sample.
Central differences inside, one-sided differences at the two ends, so the answer is as long as the run it came from. A run of fewer than two samples has no rate of change.