Does the "Weighted Median" Exist?
Obviously it exists, you can take a median of medians. Using weighted medians is just an extension.
The more relevant question is whether it is useful to use a median of medians and to use weights.
Is it still common practice to calculate "weighted median" estimators just as we did above? Or does this "ruin" the purpose of the median by "contaminating" all the medians with each other (i.e. influencing) - thus no longer a "true median"?
If the sample medians are drawn from populations with the same distribution then the median of medians will be biased (just like a sample median can be biased), but it is consistent. The quantile of the medians will follow a beta distribution which approaches the 0.5 point when the sample sizes increase.
Using weights can improve the properties of the median of medians statistic if the different medians do not follow the same beta distribution.
Below is an example where we simulated the median of medians by using two times ten samples from different beta distributions (representing a sample of twenty medians each sampled based on different sample sizes) and combine them with different weights. It shows that there is an optimal weight.
set.seed(1)
sample = function(n=10, weights = c(1,2)) {
x = rbeta(n,3,3)
y = rbeta(n,10,10)
standard = median(c(x,y))
weighted = median(c(rep(x,weights[1]),rep(y,weights[2])))
return(c(standard, weighted))
}
weights = matrix(c(1,2,
1,3,
1,4,
1,5,
2,3,
2,5,
3,4,
3,5,
4,5),9, byrow = 1)
standard = rep(NA,9)
weighted = rep(NA,9)
k = 1:9
for (ki in k) {
s = replicate(3*10^4,sample(10, weights = weights[ki,]))
standard[ki] = var(s[1,])
weighted[ki] = var(s[2,])
}
plot(weights[,1]/weights[,2],standard, ylim = range(c(standard,weighted)), xlab = "ratio of weights", ylab = "variance of statistic")
points(weights[,1]/weights[,2],weighted,col = 2)
legend(0.2, 0.00145, c("standard","weighted"), col = c(1,2))
Whether this approach has been applied somewhere in practice or literature I do not know. But the above shows that in principle the weighted median of medians exists and can make sense.