findCutoff | R Documentation |
Finds cutoff point on knee curve
findCutoff(x, y, method = "first", frac.of.steepest.slope = 0.5)
x |
vector of x coordinates of points around curve |
y |
vector of y coordinates of points around curve |
method |
the method to define the knee point. Value can be "first" for first derivative cutoff or "curvature" for maximum curvature cutoff. |
frac.of.steepest.slope |
the slope at the cutoff point relative to the steepest (positive or negative) slope on the curve. Only used if method is set to "first". Can be set to any number > 0 or <= 1. If the knee curve is increasing and concave down, then lower numbers will lead to higher knee points, and higher numbers will lead to lower knee points. |
a list containing the (x, y) coordinates of the knee point chosen using the specified method
# Generate some knee data x <- runif(100, min=-3, max=3) y <- -exp(-x) * (1+rnorm(100)/3) plot(x, y) # Plot knee points calculated using two different methods points(findCutoff(x,y), col="red", pch=20, cex=3) points(findCutoff(x,y, method="curvature"), col="blue", pch=20, cex=3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.