### Question:
ProfileToNetwork { protected static void computeCorrelationTerms(Matrix profile, Vector means, Vector stdevs, Vector counts) { Vector sqrtCounts = counts.copy(); MatrixUtils.sqrt(sqrtCounts); MatrixUtils.elementMult(stdevs, sqrtCounts); for (MatrixEntry e: profile) { double x = (e.get() - means.get(e.column())) / (stdevs.get(e.column()) + 0.0000000000001d); e.set(x); } }  static Matrix continuousProfile(Matrix profile, int k); static Matrix continuousProfile(Matrix profile, int k, double maxMissingPercentage); static Object [] continuousProfileWithNames(Matrix profile, int k, String [] names, Map<String, String> identifierMap, double maxMissingPercentage); static Matrix ThresholdOnly(Matrix profile, double low, double hi); static double sillyColumnMult(Matrix terms, int i, int j); static void setHiLow(Matrix network, Matrix correlations, int i, double hi, double low); static Matrix binaryProfile(Matrix profile, int k); static Object[] averageRepeatedIdentifiers(Matrix profile, String [] names, Map<String, String> identifierMap); static void findNaNs(Matrix m); static void findNaNs(Vector v); static void convertProfileToRanks(Matrix profile);  }### Answer:
@Test public void testNormalizaton() { Matrix profile = new DenseMatrix(new double [][] {{10,2,3,4,5},{6,17,8,9,10},{11,12,23,14,15},{16,17,18,29,20},{21,22,23,24,35}}); Vector counts = MatrixUtils.columnCountsIgnoreMissingData(profile); Vector means = MatrixUtils.columnMeanIgnoreMissingData(profile, counts); Vector stdevs = MatrixUtils.columnVarianceIgnoreMissingData(profile, means); MatrixUtils.sqrt(stdevs); ProfileToNetwork.computeCorrelationTerms(profile, means, stdevs, counts); Matrix result = new DenseMatrix(profile.numRows(), profile.numRows()); profile.transAmult(profile, result); Vector ones = new DenseVector(profile.numRows()); ones.add(1d, ones); Vector sums = new DenseVector(profile.numRows()); profile.mult(ones, sums); for (int i=0; i<sums.size(); i++) { assertEquals(0d, sums.get(i), .00001d); } for (int i=0; i<result.numRows(); i++) { assertEquals(1d, result.get(i, i), .00001d); } }