Skip to main content
Module

x/statistics/mod.ts>quantileSorted

Deno basic statistics module.
Latest
function quantileSorted
Re-export
import { quantileSorted } from "https://deno.land/x/statistics@v0.1.1/mod.ts";

This is the internal implementation of quantiles: when you know that the order is sorted, you don't need to re-sort it, and the computations are faster.

Examples

quantileSorted([3, 6, 7, 8, 8, 9, 10, 13, 15, 16, 20], 0.5); // => 9

Parameters

x: number[]

sample of one or more data points

p: number

desired quantile: a number between 0 to 1, inclusive

Returns

number

quantile value