final RealMatrix covarianceMatrix = new Covariance(matrix).getCovarianceMatrix();
// Variances on the diagonal
Variance variance = new Variance();
for (int i = 0; i < 5; i++) {
Assert.assertEquals(variance.evaluate(matrix.getColumn(i)), covarianceMatrix.getEntry(i,i), 10E-14);
}
// Symmetry, column-consistency
Assert.assertEquals(covarianceMatrix.getEntry(2, 3),
new Covariance().covariance(matrix.getColumn(2), matrix.getColumn(3), true), 10E-14);