MultivariateGaussian implements Likelihood { public double compute(double[][] data) { double[][] other = new double[data.length - 2][]; System.arraycopy(data, 2, other, 0, data.length - 2); return compute(data[0], data[1], other); }  double compute(double[][] data); double compute(double[] x, double[] mu, double[][] sigma);  }
@Test public void testComputeInternal() { assertEquals(-1.416119, d_mvg.compute(new double[] {0.5, 0.3}, d_mu, d_sigma), EPSILON); assertEquals(-1.357296, d_mvg.compute(new double[] {0.3, 0.5}, d_mu, d_sigma), EPSILON); assertEquals(-1.298472, d_mvg.compute(new double[] {0.1, 0.3}, d_mu, d_sigma), EPSILON); assertEquals(-74.33083, d_mvg.compute(new double[] {10.0, 0.0}, d_mu, d_sigma), EPSILON * 10); assertEquals(-12.88965, d_mvg.compute(new double[] {-3.0, 2.0}, d_mu, d_sigma), EPSILON * 10); }
@Test public void testCompute() { double[][] input = new double[][] { {0.5, 0.3}, d_mu, d_sigma[0], d_sigma[1] }; assertEquals(-1.416119, d_mvg.compute(input), EPSILON); }