public static final <T> double biasedCovariance(Map<T, ? extends Number> a, Map<T, ? extends Number> b) {
		double sum = 0;
		final double aMean = mean(a.values());
		final double bMean = mean(b.values());
		double n = 0;
		for (T key : a.keySet()) {
			if (a.containsKey(key) && b.containsKey(key)) {
				sum += ((a.get(key).doubleValue() - aMean) * (b.get(key).doubleValue() - bMean));
				n++;
			}
		}
		if (n == 0) {
			return 0;
		}
		return sum / n;
	}