Calculates weighted quantiles for a vector of values using linear interpolation between midpoint plotting positions.
Details
Drops non-finite values and non-positive weights, sorts the survivors by
value, then delegates to weighted_quantiles_presorted for the
interpolation. (Splitting out the sorted core lets hot callers sort once and
reuse the order.)
Each observation is placed at the midpoint of its own weight block,
\((\sum_{k \le i} w_k - w_i/2) / \sum_k w_k\), and quantiles are linearly
interpolated between those positions. For equal weights the positions are
\((i - 0.5)/n\), so the unweighted case reduces to the standard Hazen
(type-5) quantile. Before v0.71.1 the upper edge \(\sum_{k \le i} w_k\)
was used instead, which biased every quantile downward in proportion to how
concentrated the weights were; see NEWS for the size of the effect on
calc_model_ensemble().
