/** * Calculates the [Shannon entropy]{@link https://en.wikipedia.org/wiki/Entropy_(information_theory)} for a probability * distribution. * * @method entropy * @memberof ran.dispersion * @param {number[]} probabilities Array representing the probabilities for the i-th value. * @param {number=} base Base for the logarithm. If not specified, natural logarithm is used. * @returns {number} Entropy of the probabilities, or NaN for empty input. * @example * * ran.dispersion.entropy([]) * // => NaN * * ran.dispersion.entropy([0.1, 0.1, 0.8]) * // => 0.639031859650177 * * ran.dispersion.entropy([0.3, 0.3, 0.4]) * // => 1.0888999753452238 */ export default function (probabilities: number[], base?: number | undefined): number;