1 |
|
2 |
|
3 | # Function quantileSeq
|
4 |
|
5 | Compute the prob order quantile of a matrix or a list with values.
|
6 | The sequence is sorted and the middle value is returned.
|
7 | Supported types of sequence values are: Number, BigNumber, Unit
|
8 | Supported types of probability are: Number, BigNumber
|
9 |
|
10 | In case of a (multi dimensional) array or matrix, the prob order quantile
|
11 | of all elements will be calculated.
|
12 |
|
13 |
|
14 | ## Syntax
|
15 |
|
16 | ```js
|
17 | math.quantileSeq(A, prob[, sorted])
|
18 | math.quantileSeq(A, [prob1, prob2, ...][, sorted])
|
19 | math.quantileSeq(A, N[, sorted])
|
20 | ```
|
21 |
|
22 | ### Parameters
|
23 |
|
24 | Parameter | Type | Description
|
25 | --------- | ---- | -----------
|
26 | `data` | Array, Matrix | A single matrix or Array
|
27 | `probOrN` | Number, BigNumber, Array | prob is the order of the quantile, while N is the amount of evenly distributed steps of probabilities; only one of these options can be provided
|
28 | `sorted` | Boolean | =false is data sorted in ascending order
|
29 |
|
30 | ### Returns
|
31 |
|
32 | Type | Description
|
33 | ---- | -----------
|
34 | Number, BigNumber, Unit, Array | Quantile(s)
|
35 |
|
36 |
|
37 | ## Examples
|
38 |
|
39 | ```js
|
40 | math.quantileSeq([3, -1, 5, 7], 0.5) // returns 4
|
41 | math.quantileSeq([3, -1, 5, 7], [1/3, 2/3]) // returns [3, 5]
|
42 | math.quantileSeq([3, -1, 5, 7], 2) // returns [3, 5]
|
43 | math.quantileSeq([-1, 3, 5, 7], 0.5, true) // returns 4
|
44 | ```
|
45 |
|
46 |
|
47 | ## See also
|
48 |
|
49 | [median](median.md),
|
50 | [mean](mean.md),
|
51 | [min](min.md),
|
52 | [max](max.md),
|
53 | [sum](sum.md),
|
54 | [prod](prod.md),
|
55 | [std](std.md),
|
56 | [variance](variance.md)
|