Add function to calculate entropy of discrete distributions.