kneePoint: Find Knee (or elbow) point of a curve

View source: R/probMap.R

kneePointR Documentation

Find Knee (or elbow) point of a curve

Description

This function calculates the knee/elbow point of a curve based on the kneedle algorithm (satopaa et al, 2011). This is used internally in 'moleculaR::.calcGaussBW'. This is a simplified implementation.

Usage

kneePoint(
  x,
  y,
  df = 7,
  xQuery = seq(range(x)[1], range(x)[2], 0.1),
  plot = FALSE,
  sign = +1,
  ...
)

Arguments

sign

+1 for increasing values (knee) and -1 for decreasing values (elbow).

x:

x values representing the bandwidth values

y:

y values representing the Moran's I statistic.

df:

degrees of freedom for the smoothing spline.

plot:

whether to plot the result.

xQuery:

x values to be used for smoothing the original curve via a fitted spline.

...:

arguments passed to 'plot'.

Value

Returns a numeric, the calculated knee point representing the optimum bandwidth.

References

Satopaa, Ville, et al. "Finding a" kneedle" in a haystack: Detecting knee points in system behavior." 2011 31st international conference on distributed computing systems workshops. IEEE, 2011. (doi: 10.1109/ICDCSW.2011.20)


CeMOS-Mannheim/moleculaR documentation built on April 14, 2025, 8:27 a.m.