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], 1/4)In the solver,
Open in the solverquantile([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 1/4)gives3.quantile([5, 1, 4, 2, 3], [0, 1/2, 1])In the solver,
Open in the solverquantile([5, 1, 4, 2, 3], [0, 1/2, 1])gives[1, 3, 5].quantile(normal_distribution(0, 1), 19/20)In the solver,
Open in the solverquantile(normal_distribution(0, 1), 19/20)givessqrt(2)*inverse_erf(9/10).quantile(exponential_distribution(lambda), q)In the solver,
Open in the solverquantile(exponential_distribution(lambda), q)gives-ln(1 - q)/lambda.
Functions its examples use
- normal_distribution
The normal distribution with mean mu and standard deviation sigma.
- exponential_distribution
The waiting time for events that come at rate lambda.
Related functions
- 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.