quantiles functions
quantiles
Syntax: quantiles(level1, level2, ...)(x)
All the quantile functions also have corresponding quantiles functions: quantiles, quantilesDeterministic, quantilesTiming, quantilesTimingWeighted, quantilesExact, quantilesExactWeighted, quantileExactWeightedInterpolated, quantileInterpolatedWeighted, quantilesTDigest, quantilesBFloat16, quantilesDD. These functions calculate all the quantiles of the listed levels in one pass, and return an array of the resulting values.
quantilesExactExclusive
Exactly computes the quantiles of a numeric data sequence.
To get exact value, all the passed values are combined into an array, which is then partially sorted. Therefore, the function consumes O(n) memory, where n is a number of values that were passed. However, for a small number of values, the function is very effective.
This function is equivalent to PERCENTILE.EXC Excel function, (type R6).
Works more efficiently with sets of levels than quantileExactExclusive.
Syntax
Arguments
- expr— Expression over the column values resulting in numeric data types, Date or DateTime.
Parameters
- level— Levels of quantiles. Possible values: (0, 1) — bounds not included. Float.
Returned value
- Array of quantiles of the specified levels.
Type of array values:
- Float64 for numeric data type input.
- Date if input values have the Datetype.
- DateTime if input values have the DateTimetype.
Example
Query:
Result:
quantilesExactInclusive
Exactly computes the quantiles of a numeric data sequence.
To get exact value, all the passed values are combined into an array, which is then partially sorted. Therefore, the function consumes O(n) memory, where n is a number of values that were passed. However, for a small number of values, the function is very effective.
This function is equivalent to PERCENTILE.INC Excel function, (type R7).
Works more efficiently with sets of levels than quantileExactInclusive.
Syntax
Arguments
- expr— Expression over the column values resulting in numeric data types, Date or DateTime.
Parameters
- level— Levels of quantiles. Possible values: [0, 1] — bounds included. Float.
Returned value
- Array of quantiles of the specified levels.
Type of array values:
- Float64 for numeric data type input.
- Date if input values have the Datetype.
- DateTime if input values have the DateTimetype.
Example
Query:
Result:
quantilesGK
quantilesGK works similarly with quantileGK but allows us to calculate quantities at different levels simultaneously and returns an array.
Syntax
Returned value
- Array of quantiles of the specified levels.
Type of array values:
- Float64 for numeric data type input.
- Date if input values have the Datetype.
- DateTime if input values have the DateTimetype.
Example
Query:
