netsse.tools.misc_func.weighted_quantile ======================================== .. py:function:: netsse.tools.misc_func.weighted_quantile(x, q, w, a=0.5, b=0.5, axis=-1) Computes the `q`-th quantiles of weighted data. The quantiles are computed along one of the axes of the input array ``x``. :param x: Input data array for which the quantiles must be computed. :type x: array_like :param q: Sequence of quantiles to compute, which must be between 0 and 1. :type q: 1d-array of shape (Nq,) :param w: Array of weights. The arrays ``x`` and ``w`` must be broadcastable. :type w: array_like :param a: User-defined constant used in the computation of the quantiles. The default is 0.5 to minimize biases (Rogers, 2003). :type a: floats, default 0.5 :param b: User-defined constant used in the computation of the quantiles. The default is 0.5 to minimize biases (Rogers, 2003). :type b: floats, default 0.5 :param axis: Axis of ``x`` along which the ``q``-quantiles are computed. :type axis: integer, default -1 :returns: **v** -- Values of the ``q``-quantiles computed along the specified ``axis`` of the input array ``x`` with weights ``w``. :rtype: array_like .. seealso:: :py:obj:`weighted_std` Computes the weighted standard deviation of some data. .. rubric:: References Rogers, J.W., 2003. Estimating the variance of percentiles using replicate weights, in: Proc. of the Joint Statistical Meetings, Survey Research Methods Section, American Statistical Association. pp. 3525–3532. URL: http://www.asasrms.org/Proceedings/y2003/Files/JSM2003-000742.pdf .. rubric:: Example >>> v = weighted_quantile(x, q, w, a=0.5, b=0.5, axis=-1)