DescrStatsW.quantile(probs, return_pandas=True)
[source]
Compute quantiles for a weighted sample.
Parameters: |
|
---|---|
Returns: |
quantiles –
If |
Return type: |
Series, DataFrame, or ndarray |
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.
SAS documentation for weighted quantiles:
© 2009–2012 Statsmodels Developers
© 2006–2008 Scipy Developers
© 2006 Jonathan E. Taylor
Licensed under the 3-clause BSD License.
http://www.statsmodels.org/stable/generated/statsmodels.stats.weightstats.DescrStatsW.quantile.html