Here you can find the source of distortion(double[] xvalues, double[] yvalues, int[] include)
public static double distortion(double[] xvalues, double[] yvalues, int[] include)
//package com.java2s; //License from project: Open Source License public class Main { /**/* w w w. j av a 2s.c o m*/ * Returns the sum of the squared difference of xvalues and yvalues for non-zero * include index values */ public static double distortion(double[] xvalues, double[] yvalues, int[] include) { double ddiff; double dsumsq = 0; for (int nindex = 0; nindex < include.length; nindex++) { if (include[nindex] != 0) { ddiff = (xvalues[nindex] - yvalues[nindex]); dsumsq += ddiff * ddiff; } } return dsumsq; } }