Here you can find the source of sumOfSquares(List
private static double sumOfSquares(List<Double> samples)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { private static double sumOfSquares(List<Double> samples) { double sumOfSquares = 0; for (double sample : samples) { sumOfSquares += sample * sample; }//from w w w .j a v a 2 s .c o m return sumOfSquares; } }