Useful routine. It can be optimized, though, by using sumVec=cumsum(wSort) -- it gave me a speed-up of more than 300 in a particular case for which I had about 50000 elements.
Useful routine. It can be optimized, though, by using sumVec=cumsum(wSort) -- it gave me a speed-up of more than 300 in a particular case for which I had about 50000 elements.
Comment only
30 Mar 2009
weighted median
Function for calculating the weighted median
Comment only