calculate mutual information.