Weighted Empirical Cumulative Distribution Function

Hi - has anyone ever coded this up in KDB? Thx

Hi Ben- does this work? Thanks,

The weighted empirical cumulative distribution function estimator is given by:

F^(x)=(1/?ni=1wi)?(i=1 .. n) wiI(Xi?x)

 

x:100?1f

w:c#reciprocal c:count x

ewcdf:{[x;y;w] sum w where x <= y}

ewcdf[x;0.5;w]