Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

Quantile (quantile)

The smallest value with at least a share q of a list, or a chance q of a distribution, at or below it.

How to write it

quantile(data, q)

The value at position ceil(n q) in order, or the first for q = 0. It is never between two values.

data
The numbers. They are put in order, so symbols are not allowed. Takes a list.
q
A share from 0 to 1, or a list of them. Takes a number, or a list.

quantile(distribution, q)

The value that a variable with the distribution stays at or below with chance q: the inverse of cdf.

distribution
A normal, lognormal, uniform, exponential or Weibull distribution. Takes an expression.
q
The chance, a number above 0 and below 1, or a symbol. Takes an expression.

Examples

  • quantile⁡([1,2,3,4,5,6,7,8,9,10],14)=3\displaystyle \operatorname{quantile}\left(\left[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 \right], \frac{1}{4}\right) = 3
    quantile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1/4)

    In the solver, quantile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1/4) gives 3.

    Open in the solver
  • quantile⁡([5,1,4,2,3],[0,12,1])=[1,3,5]\displaystyle \operatorname{quantile}\left(\left[ 5, 1, 4, 2, 3 \right], \left[ 0, \frac{1}{2}, 1 \right]\right) = \left[ 1, 3, 5 \right]
    quantile([5, 1, 4, 2, 3], [0, 1/2, 1])

    In the solver, quantile([5, 1, 4, 2, 3], [0, 1/2, 1]) gives [1, 3, 5].

    Open in the solver
  • quantile⁡(normal_distribution⁡(0,1),1920)=2erf⁡−1(910)\displaystyle \operatorname{quantile}\left(\operatorname{normal\_distribution}(0, 1), \frac{19}{20}\right) = \sqrt{2} \operatorname{erf}^{-1}\left(\frac{9}{10}\right)
    quantile(normal_distribution(0, 1), 19/20)

    In the solver, quantile(normal_distribution(0, 1), 19/20) gives sqrt(2)*inverse_erf(9/10).

    Open in the solver
  • quantile⁡(exponential_distribution⁡(λ),q)=−ln⁡(1−q)λ\displaystyle \operatorname{quantile}(\operatorname{exponential\_distribution}(\lambda), q) = -\frac{\ln(1-q)}{\lambda}
    quantile(exponential_distribution(lambda), q)

    In the solver, quantile(exponential_distribution(lambda), q) gives -ln(1 - q)/lambda.

    Open in the solver

Functions its examples use

  • standard_deviation

    The sample standard deviation of a list of numbers, or that of a distribution.

  • probability

    The probability that a condition holds for a variable with a distribution.

  • stationary_distribution

    The law a process settles into over time, when it has one.

  • poisson_distribution

    The number of events in a period when they come at an average rate lambda.

  • uniform_distribution

    The continuous distribution that is equally likely anywhere between a and b.

  • pdf

    The density of a distribution at a point, or the probability of a value for a discrete one.