/** * Calculates the mode(s) of a sample. In case of discrete values (integers), it returns the values corresponding to the * highest frequencies in ascending order. For continuous sample, the mode is estimated using the * [half-sample mode algorithm]{@link https://arxiv.org/pdf/math/0505419.pdf}. * * @method mode * @memberof ran.location * @param {number[]} values Array of values to calculate mode for. * @returns {number|number[]} The estimated mode (continuous sample) or an array of modes (discrete sample). * Returns an empty array for empty input. * @example * * ran.location.mode([]) * // => [] * * ran.location.mode([1]) * // => [1] * * ran.location.mode([1, 1, 2, 2, 3]) * // => [1, 2] * * ran.location.mode([1, 2, 2, 2, 3]) * // => [2] * * ran.location.mode([1.2, 3.4, 5.6]) * // => 4.5 */ export default function (values: number[]): number | number[];