public static double sd(SlidingWindow left, SlidingWindow right) { int n = left.maxSize + right.maxSize; double sumOfSquares = (left.sumOfSquares() + right.sumOfSquares()); double sum = left.sum() + right.sum(); return Math.sqrt((n * (sumOfSquares) - (sum * sum)) / (n * (n - 1))); }
public static double mean(SlidingWindow left, SlidingWindow right) { return (left.mean() + right.mean()) / 2; }