README.md

KneeArrower

R package to find cutoff points on knee curves.

Example: 100 random simulated points (gray) and the knee point (red) found using this package.

A curve with a knee point

Install

library(devtools)

install.packages("signal")
install_github("agentlans/KneeArrower")

Use

The following code shows example of finding knee points. More options are available. Please see the package vignette for more details.

library(KneeArrower)

# Generate an example knee curve
x <- seq(0, 5, 0.05)
y <- log(1+x)

# Find the cutoff point.
# By default, it's the point at which the first derivative is half of maximum along the curve.
findCutoff(x, y)

# For more information on the options, view the help file for findCutoff
?findCutoff

Frequently Asked Questions and Troubleshooting

How does this work?

  1. The points are fitted to a curve using the Savitzky-Golay filter to eliminate bumps and rough edges.
  2. Then the first derivative is calculated from the curve. The "first derivative cutoff method" (default) interpolates a point where the slope is equal to a given value.
  3. The second derivative can also be calculated. In fact, the "maximum curvature method" searches for a knee point by optimizing an expression containing second derivatives.

What does this mean?

Why doesn't the output point look like a knee point?

The output point doesn't match the knee point I found using calculus!

What happens if there's more than one knee point?

How come I can't install vignettes?

Author, License

Copyright 2018, 2019, 2020-2022 Alan Tseng

GNU General Public License v3



agentlans/KneeArrower documentation built on May 17, 2022, 7:32 p.m.