Numerical approximation of a derivative of a piece-wise $C^1$ function. Let $F$ be a non-decreasing continuous  piece-wise-$C^1$ positive function (you might call it a cumulative distribution function with a piece-wise continuous density). I have its values $F_i = F(i\Delta)$ for $i\in \Bbb N$, $i\le N$, and $\Delta >0$. I know also that $F(0)=0$ and that $F(x) = F(N\Delta)$ for $x>N\Delta$.
What would be a "good" approximation of the derivative of this function $F$? (we need to define "good", of course)


*

*Usual finite difference approximation of derivatives. I have doubts about this method, because our function is not even globally $C^1$, and this method works best for regular functions.

*Discrete convolution with some kernel - what would be the best kernel for my needs? If I understand correctly, there are quite a lot of such kernels.

*Polynomial interpolations (quadratic splines, for example)
I'd be grateful for a comparison - or a link to such a comparison - of the methods to approximate a derivative in a similar setting.
 A: If your function is only known at points, I see no way that you can recover the piecewise nature of the function. The function class will be entirely controlled by the interpolant. But I think there are still ways to get something reasonable if you know where the discontinuities are.


*

*You could use one-sided finite-differences at discontinuities, and two sided elsewhere. This will only give you the derivative at points but it should be sensible-just very low accuracy.

*If you want a derivative at any point, I recommend the compactly-supported cubic B-spline. It takes $O(1)$ time to evaluate, $O(N)$ time to construct and is numerically stable. It represents your function as piecewise-$C^2$-not the class you want so you'll need to split it into multiple intervals to get it to represent your function as piecewise $C^1$. Code for this exists and should be in the upcoming version of boost. The idea behind the algorithm is given in Numerical Analysis by Kress. You can also adapt the algorithm to represent your function as piecewise $C^1$, but I don't think you have control over where the discontinuities lies so as a practical matter I'm not sure it would help.

*I would stay well away from polynomial interpolation, as it becomes fiercely ill-conditioned and produces nonsense with as few as 10 points.
I have no experience with discrete convolution methods, so hopefully someone else can help you out there.
