I have thousands of stepwise increasing function (offer curve) each with a number of discontinuities ranging from 10 to 22. I have to approximate all these functions to stepwise functions having the same jump for all of them. I have to find the proper grid on the x-axis which not necessarily has to be equispaced. Indeed, all functions have more jumps for a specific range of the x-axis.
What I thought to do was taking all the x point of all the discontinuities of all functions and compute the distance of each of these with the right next jump point. In this way, looking where are the shortest distances, I would find the window where there are more jumps.
This procedure fails because I have so many functions that almost all the distance computed were very short and not comparable.
Below a picture of what is my technique.
Any suggestion is welcome.
