quantile

quantile returns quantile of a data vector rvX for the cumulative probability rvP in the interval 0 to 1. For rvP = 0.5 the median is returned. For rvP = 1 the maximum is returned.

rvY = quantile(rvX, rvP)
rvY = quantile(rvX, rvP, bInterpol)

Returnwert

Return Value

rvY is a vector with quantile values having the same length as rvP. The function uses linear interpolation if bInterpol is TRUE (1).

Parameter

Parameters

rvX

rvX is a real vector.

rvP

rvP is a real vector in the range 0 to 1.

bInterpol

If bInterpol is TRUE (1) the function uses linear interpolation. Default value is FALSE (0).

Beispiel

Example

* quantile([5,12,7,24,19,9], 0.5)
  12.0000

* quantile([5,12,7,24,19,9], 0.5, TRUE)
  10.5000

id-707342