Here you can find the source of meanSquaredError(double[] x, double[] y)
public static double meanSquaredError(double[] x, double[] y)
//package com.java2s; //License from project: Open Source License public class Main { public static double meanSquaredError(double[] x, double[] y) { double mse = 0; for (int i = 0; i < x.length; ++i) { mse += Math.pow(x[i] - y[i], 2); }//from w ww. j av a 2s. com return mse / (double) x.length; } }