Skip to content
@addmaple/stats
Search
K
Main Navigation
Guide
API Reference
Examples
GitHub
Appearance
Menu
Return to top
On this page
weightedPercentile
Calculate a weighted percentile.
Try it out
Try it out
Run
import { init, weightedPercentile } from '@addmaple/stats'; await init(); const data = [1, 2, 3, 4, 5]; const weights = [1, 1, 2, 1, 1]; const result = weightedPercentile(data, weights, 0.5); result;
Initializing library...