This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const amount = 10000; // the smaller the amount, the more the bucket median is off | |
const data = generateValues(amount, 300); | |
console.log({ | |
amount, | |
normalMedian: normalMedian(data.values), | |
bucketMedian: bucketMedian(data.buckets), | |
}); | |
function normalMedian(arr) { |