kneepointDetection: Fits 2 regression lines to data to estimate the knee (or...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/kneepointDetection.R

Description

With an appropriate sigma value, the curve of eigenvalues has a knee point shape. The bending point is a good estimate for the number of informative spectral clusters because the eigenvalues above the corresponding threshold can reasonably be assumed to be close to 1. This function estimate the knee point by fitting 2 lines using linear regression.

Usage

1
  kneepointDetection(vect, PlotFlag=FALSE)

Arguments

vect

The vector of values on which the 2 regression lines will be fitted.

PlotFlag

If TRUE and in unix, an animation will be produced in tmpfigs folder that shows how the best selected model in gif format.

Details

The running time is in order of minutes for 100 points. This function was borrowed from flowMeans package and for application in SamSPECTRAL package, it was customized such that the first line is always horizontal.

Value

Returns a list where MinIndex is the index of the knee point and l1 and l2 the fitted lines.

Author(s)

Nima Aghaeepour

References

Aghaeepour N., Nikolic R., Hoos HH., Brinkman RR.: Rapid cell population identification in flow cytometry data. Cytometry A, 2011, 79:6.

See Also

changepointDetection

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  ## Data
    values <- rep(1,times=10)
    values <- c(values,(10:0)/10)
    
  ## Looks like knee point:
  plot(values)

  ## Find the knee point:
  detected <- kneepointDetection(vect=values, PlotFlag=FALSE)
  print(detected$MinIndex)
  ##  Also, under unix, set PlotFlag=TRUE and look at animation.gif.

SamSPECTRAL documentation built on Nov. 8, 2020, 5:08 p.m.