I don’t think this approach can work: the empirical CDF is a step function, which is not numerically differentiable in a meaningful way (i.e. the derivative is zero, except at the 1000 points where it is undefined). Perhaps a histogram comes closer to what you’re looking for?