mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
61 lines
2.0 KiB
Markdown
61 lines
2.0 KiB
Markdown
---
|
|
layout: default
|
|
---
|
|
|
|
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
|
|
|
<h1 id="function-quantileseq">Function quantileSeq <a href="#function-quantileseq" title="Permalink">#</a></h1>
|
|
|
|
Compute the prob order quantile of a matrix or a list with values.
|
|
The sequence is sorted and the middle value is returned.
|
|
Supported types of sequence values are: Number, BigNumber, Unit
|
|
Supported types of probability are: Number, BigNumber
|
|
|
|
In case of a (multi dimensional) array or matrix, the prob order quantile
|
|
of all elements will be calculated.
|
|
|
|
|
|
<h2 id="syntax">Syntax <a href="#syntax" title="Permalink">#</a></h2>
|
|
|
|
```js
|
|
math.quantileSeq(A, prob[, sorted])
|
|
math.quantileSeq(A, [prob1, prob2, ...][, sorted])
|
|
math.quantileSeq(A, N[, sorted])
|
|
```
|
|
|
|
<h3 id="parameters">Parameters <a href="#parameters" title="Permalink">#</a></h3>
|
|
|
|
Parameter | Type | Description
|
|
--------- | ---- | -----------
|
|
`data` | Array, Matrix | A single matrix or Array
|
|
`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
|
|
`sorted` | Boolean | =false is data sorted in ascending order
|
|
|
|
<h3 id="returns">Returns <a href="#returns" title="Permalink">#</a></h3>
|
|
|
|
Type | Description
|
|
---- | -----------
|
|
Number, BigNumber, Unit, Array | Quantile(s)
|
|
|
|
|
|
<h2 id="examples">Examples <a href="#examples" title="Permalink">#</a></h2>
|
|
|
|
```js
|
|
math.quantileSeq([3, -1, 5, 7], 0.5) // returns 4
|
|
math.quantileSeq([3, -1, 5, 7], [1/3, 2/3]) // returns [3, 5]
|
|
math.quantileSeq([3, -1, 5, 7], 2) // returns [3, 5]
|
|
math.quantileSeq([-1, 3, 5, 7], 0.5, true) // returns 4
|
|
```
|
|
|
|
|
|
<h2 id="see-also">See also <a href="#see-also" title="Permalink">#</a></h2>
|
|
|
|
[median](median.html),
|
|
[mean](mean.html),
|
|
[min](min.html),
|
|
[max](max.html),
|
|
[sum](sum.html),
|
|
[prod](prod.html),
|
|
[std](std.html),
|
|
[variance](variance.html)
|