UNPKG

1.55 kBMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function quantileSeq
4
5Compute the prob order quantile of a matrix or a list with values.
6The sequence is sorted and the middle value is returned.
7Supported types of sequence values are: Number, BigNumber, Unit
8Supported types of probability are: Number, BigNumber
9
10In case of a (multi dimensional) array or matrix, the prob order quantile
11of all elements will be calculated.
12
13
14## Syntax
15
16```js
17math.quantileSeq(A, prob[, sorted])
18math.quantileSeq(A, [prob1, prob2, ...][, sorted])
19math.quantileSeq(A, N[, sorted])
20```
21
22### Parameters
23
24Parameter | 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
32Type | Description
33---- | -----------
34Number, BigNumber, Unit, Array | Quantile(s)
35
36
37## Examples
38
39```js
40math.quantileSeq([3, -1, 5, 7], 0.5) // returns 4
41math.quantileSeq([3, -1, 5, 7], [1/3, 2/3]) // returns [3, 5]
42math.quantileSeq([3, -1, 5, 7], 2) // returns [3, 5]
43math.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)