quickselectFSw finds the 100*p-th weighted order statistic for $0<p<1$
quickselectFSw generalises the calculation of the weighted median to a generic percentile $100pth (0<p<1)$. It finds the p-th weighted order statistic in the elements of a data vector $D$ considering the associated weights $W$. More precisely, the algorithm finds the element $D_{k^{*}}$ that make the following difference as small as possible: $\sum_{i=1}^{k^{*}_{p} - 1} w_{i} - \sum_{i=k^{*}_{p}+1}^{n} w_{i}$.
The linear algorithm used for the computation extends quickselectFS.
REMARK: we also provide the mex counterpart, quickselectFSwmex; see the last example to understand how it works.
Bleich, C. and Overton, M.L. (1983), A linear-time algorithm for the weighted median problem. Technical Report 75, New York University, Courant Institute of Mathematical Sciences.
Azzini, I., Perrotta, D. and Torti, F. (2023), A practically efficient fixed-pivot selection algorithm and its extensible MATLAB suite, "arXiv, stat.ME, eprint 2302.05705"