simple-squiggle

A restricted subset of Squiggle
Log | Files | Refs | README

quantileSeq.md (1604B)


      1 <!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
      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 ### Throws
     38 
     39 Type | Description
     40 ---- | -----------
     41 
     42 
     43 ## Examples
     44 
     45 ```js
     46 math.quantileSeq([3, -1, 5, 7], 0.5)         // returns 4
     47 math.quantileSeq([3, -1, 5, 7], [1/3, 2/3])  // returns [3, 5]
     48 math.quantileSeq([3, -1, 5, 7], 2)           // returns [3, 5]
     49 math.quantileSeq([-1, 3, 5, 7], 0.5, true)   // returns 4
     50 ```
     51 
     52 
     53 ## See also
     54 
     55 [median](median.md),
     56 [mean](mean.md),
     57 [min](min.md),
     58 [max](max.md),
     59 [sum](sum.md),
     60 [prod](prod.md),
     61 [std](std.md),
     62 [variance](variance.md)