weighted median
For n numbers x_1,...,x_n with positive weights w_1,...,w_n,
(sum of all weights equal to one) the weighted median is defined as
the element x_k, such that:
--
) w_i <= 1/2
--
x_i < x_k
and
--
) w_i <= 1/2
--
x_i > x_k
Input: D ... matrix of observed values
W ... matrix of weights, W = ( w_ij )
Output: wMed ... weighted median
Cite As
Sven Haase (2026). weighted median (https://www.mathworks.com/matlabcentral/fileexchange/23077-weighted-median), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Acknowledgements
Inspired: Weighted median (from data & sds) & its standard deviation
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
