Compute quantiles for a weighted sample.
Parameters: | probs : array-like
return_pandas : bool
|
---|---|
Returns: | quantiles : Series, DataFrame, or ndarray
|
Notes
To compute the quantiles, first, the weights are summed over exact ties yielding distinct data values y_1 < y_2 < ..., and corresponding weights w_1, w_2, .... Let s_j denote the sum of the first j weights, and let W denote the sum of all the weights. For a probability point p, if pW falls strictly between s_j and s_{j+1} then the estimated quantile is y_{j+1}. If pW = s_j then the estimated quantile is (y_j + y_{j+1})/2. If pW < p_1 then the estimated quantile is y_1.
References
SAS documentation for weighted quantiles: