private static void displayMutualInformation (double[][] density, int numGridLines) {
		
		double mutualInfo = 0.0;
		
		// Calculate marginal probability in x1 direction
		ArrayList<Double> x1MarginalProb = new ArrayList<Double> ();
		for (int x1Ind = 0; x1Ind < numGridLines; x1Ind++) {
			
			Double margProb = 0.0;
			for (int x2Ind = 0; x2Ind < numGridLines; x2Ind++) {
				margProb += density[x1Ind][x2Ind];
			}
			x1MarginalProb.add(margProb);
		}
		
		// Calculate marginal probability in x2 direction
		ArrayList<Double> x2MarginalProb = new ArrayList<Double> ();
		for (int x2Ind = 0; x2Ind < numGridLines; x2Ind++) {
					
			Double margProb = 0.0;
			for (int x1Ind = 0; x1Ind < numGridLines; x1Ind++) {
				margProb += density[x1Ind][x2Ind];
			}
			x2MarginalProb.add(margProb);
		}
		
		// Calculate mutual information
		for (int x1Ind = 0; x1Ind < numGridLines; x1Ind++) {
			
			for (int x2Ind = 0; x2Ind < numGridLines; x2Ind++) {
				if (density[x1Ind][x2Ind] > 0.0) {
					double logXYxy = density[x1Ind][x2Ind]/ (x1MarginalProb.get(x1Ind) * x2MarginalProb.get(x2Ind));
					mutualInfo += density[x1Ind][x2Ind] * Math.log10(logXYxy / Math.pow(Settings.discretization, 2));
				}
			}
		}
		
		System.out.println(mutualInfo);
	} // end displayMutualInformation