List of utility methods to do Array Sum Square
double | sumSquaredError(double[] a, double[] b) Build the sum of the squared difference of all elements with the same index numbers in the arrays. if (a.length != b.length) { throw new IllegalArgumentException("Arrays must be equal length"); double sum = 0; for (int i = 0; i < a.length; i++) { double delta = a[i] - b[i]; if (!Double.isNaN(delta)) { sum += delta * delta; ... |
double | sumSquareDev(double[] values, double target) Computes the sum of squared deviations of double sumsq = 0d; for (int i = 0; i < values.length; i++) { final double dev = values[i] - target; sumsq += (dev * dev); return sumsq; |
double | sumSquareDoubleArray(double[] v) sum Square Double Array double sum = 0; for (double d : v) { sum += d * d; return sum; |
double | sumSquares(double[] aArray) Computes the sum of the squares all elements in the given array. double result = 0; for (final double a : aArray) { result += a * a; return result; |
double | sumSquares(double[] data) Sums the squares of all components; also called the energy of the array. double ans = 0.0; for (int k = 0; k < data.length; k++) { ans += data[k] * data[k]; return (ans); |
float | sumSquares(final float[] a) sum Squares return sumSquares(a, 0, a.length);
|
float | sumSquares(float[] in) sum Squares float sum = 0; for (int i = 0; i < in.length; i++) { sum += (in[i] * in[i]); return sum; |
double | sumValuesSquared(double[] vector) Compute the sum of values squared in an array double sum = 0; for (double v : vector) sum += v * v; return sum; |