deno.land / x / simplestatistic@v7.7.1 / src / median_sorted.js

median_sorted.js
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import quantileSorted from "./quantile_sorted";
/** * The [median](http://en.wikipedia.org/wiki/Median) is * the middle number of a list. This is often a good indicator of 'the middle' * when there are outliers that skew the `mean()` value. * This is a [measure of central tendency](https://en.wikipedia.org/wiki/Central_tendency): * a method of finding a typical or central value of a set of numbers. * * The median isn't necessarily one of the elements in the list: the value * can be the average of two elements if the list has an even length * and the two central values are different. * * @param {Array<number>} sorted input * @returns {number} median value * @example * medianSorted([10, 2, 5, 100, 2, 1]); // => 52.5 */function medianSorted(sorted) { return quantileSorted(sorted, 0.5);}
export default medianSorted;
simplestatistic

Version Info

Tagged at
2 years ago