MultivariateNormalDistribution extends AbstractMultivariateRealDistribution { public RealMatrix getCovariances() { return covarianceMatrix.copy(); } MultivariateNormalDistribution(final double[] means,
                                          final double[][] covariances);  MultivariateNormalDistribution(RandomGenerator rng,
                                          final double[] means,
                                          final double[][] covariances); double[] getMeans(); RealMatrix getCovariances(); double density(final double[] vals); double[] getStandardDeviations(); @Override double[] sample();  }
@Test public void testGetCovarianceMatrix() { final double[] mu = { -1.5, 2 }; final double[][] sigma = { { 2, -1.1 }, { -1.1, 2 } }; final MultivariateNormalDistribution d = new MultivariateNormalDistribution(mu, sigma); final RealMatrix s = d.getCovariances(); final int dim = d.getDimension(); for (int i = 0; i < dim; i++) { for (int j = 0; j < dim; j++) { Assert.assertEquals(sigma[i][j], s.getEntry(i, j), 0); } } }