Description: There appears to be a discrepancy of the provided target sum definition provided in the “Details” and the "Examples" section of the documentation (https://sebkrantz.github.io/collapse/reference/fquantile.html).
Details: In the “Details” section, the target sum is calculated using the formula:sumwp = (sum(w) - min(w)) * p
where min(w) is the smallest supplied weight. However, this definition does not match the computed values in the example.
In the example, min(w) seems to be defined differently: w[o][1L]
Here, o represents the indices of the ordered data, so w[o] corresponds to the weights ordered from lowest to highest according to the supplied values (x). Thus, w[o][1] gives the weight associated with the smallest value in the data, which may not necessarily be the supplied smallest weight (min(w)).
This discrepancy appears to lead to unexpected and difficult to explain results in the weighted quantile computation. Notably, the example computes the same values as the fquantile function itself. I could not replicated the fquantile results using the definition given in the description.
Request: Could someone clarify which definition of min(w) is correct? Is this a mistake in the documentation or the computation itself?
Thank you for your assistance.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4