![](https://secure.gravatar.com/avatar/3d4fcb0bbf6d3bfd68b59aff0573c7fe.jpg?s=120&d=mm&r=g)
Robert Kern wrote:
You would need to choose the length scale at which variations in the data are ignored. E.g. you need to find some means of determining why the curve should skip over A but try to get close to B.
That is exactly the problem. I can look at the data curve and know where the boundary curve should go but trying to figure out an algorithm that works in general is non trivial. If I have to do it by hand, that will severely limit the number of datasets I can analyze.
You might be able to formulate this as a constrained minimization problem using scipy.optimize.fmin_cobyla(). Take some curve f(x), minimize (f(x) - y) under the constraint (f(x) - y >= 0).
Once I have something to optimize, I was thinking that genetic algorithms might yield the fastest solution because I only need an approximate solution. Attached is an example. The green curve is boundary and the blue is data. Bill