Here you can find the source of getResidualSumOfSquares(List
public static double getResidualSumOfSquares(List<Double> response, List<double[]> samples, int ta)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static double getResidualSumOfSquares(List<Double> response, List<double[]> samples, int ta) { if (response.size() != samples.size()) throw new RuntimeException("response.size() != samples.size() " + response.size() + "," + samples.size()); double rss = 0; for (int i = 0; i < response.size(); i++) rss += Math.pow(response.get(i) - samples.get(i)[ta], 2); return rss; }//w w w .j a v a2 s. c o m }