OLS method¶
The OLS method fits a varying pair of lines using OLS linear regression
In the first iteration, one of the lines is fit to the \(2\) points and the other line is fit to the \(N-1\) points - they share the second point. The sum of their respective coefficients of determination \(R^2\) is stored as a score. In the second interation, one of the lines is fit to the \(3\) points, and the other to the \(N-3\) points - they share the third point. Again, the sum of \(R^2\) is stored as a score.
… you get the idea.
The reasoning is, since the knee is the point of maximum curvature, before and after the knee graphs usually look somewhat as lines, meaning \(R^2\) scores should kinda sorta be relatively high. If both lines have high score, there should be a knee there [1].
In theory, one could assign different weights to the lines, as to make \(x\)’s or \(y\)’s more important. The implementation does not support that, yet.