Java List Sum getResidualSumOfSquares(List response, List samples, int ta)

Here you can find the source of getResidualSumOfSquares(List response, List samples, int ta)

Description

get Residual Sum Of Squares

License

Open Source License

Declaration

public static double getResidualSumOfSquares(List<Double> response,
            List<double[]> samples, int ta) 

Method Source Code

//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
}

Related

  1. addByteToMessage(final List message, final byte bytevalue, final int checksum)
  2. adjustSumOfSquareValue(List oper, Number adjustedOper1)
  3. calculateSum(List valueList)
  4. checkSum(List stringList)
  5. getListSum(List list)
  6. getSum(final List values)
  7. getSum(List numList)
  8. getSum(List values)
  9. getSum(List longList)