Compute the 'elbow' for a curve automatically and mathematically

Jie picture Jie · Dec 17, 2010 · Viewed 19.9k times · Source

One example for curve is shown as below. The elbow point might be x=3 or 4. How to compute the elbow for a curve automatically and mathematically?

alt text

Answer

Chris Taylor picture Chris Taylor · Dec 17, 2010

You might want to look for the point with the maximum absolute second derivative which, for a set of discrete points x[i] as you have there, can be approximated with a central difference:

secondDerivative[i] = x[i+1] + x[i-1] - 2 * x[i]

As noted above, what you really want is the point with maximum curvature, but the second derivative will do, and this central difference is a good proxy for the second derivative.