# Interface MeltCurvature

public interface MeltCurvature
How the curvature should be determined.
• ## Field Summary

Fields
Modifier and Type
Field
Description
`static final MeltCurvature`
`KNEEDLE_ELBOW`
Implementation of "Finding a Kneedle in a Haystack: Detecting Knee Points in System Behavior" by Ville Satopaa; Jeannie Albrecht; David Irwin; Barath Raghavan.
`static final MeltCurvature`
`L_METHOD_ELBOW`
Implementation of the L method from: S.
`static final MeltCurvature`
`L_METHOD_KNEE`
Implementation of the L method from: S.
`static final MeltCurvature`
`LONGEST_DISTANCE_TO_ADJUSTED_STRAIT_LINE_ELBOW`

`static final MeltCurvature`
`LONGEST_DISTANCE_TO_ADJUSTED_STRAIT_LINE_KNEE`

`static final MeltCurvature`
`LONGEST_DISTANCE_TO_STRAIT_LINE_ELBOW`

`static final MeltCurvature`
`LONGEST_DISTANCE_TO_STRAIT_LINE_KNEE`

`static final MeltCurvature`
`MAX_SECOND_DERIVATIVE`
Compute the y value of the elbow point (the point with the maximum absolute second derivative).
`static final MeltCurvature`
`MAX_SLOPE`
Computes the y values where the maximum slope is detected (the highest difference of y values).
`static final MeltCurvature`
`MEDIAN`
Compute the median value (e.g.
`static final MeltCurvature`
`MENGER_ELBOW`
Menger curvature to detect elbow points.
`static final MeltCurvature`
`MENGER_KNEE`
Menger curvature to detect knee points.
`static final MeltCurvature`
`MIN_SECOND_DERIVATIVE`
Compute the y value where the second derivative has the smallest value.
`static final MeltCurvature`
`MIN_SLOPE`
Computes the y values where the minimum slope is detected (the lowest difference of y values).
• ## Method Summary

Modifier and Type
Method
Description
`default double`
`computeCurvature(double[] yVals)`

`double`
```computeCurvature(double[] xVals, double[] yVals)```
Computes the y value where the curvature changes.
`static MeltCurvature`
```configureLongestDistanceToStraightLine(boolean knee, double percentageDiff)```

`static Map<String,MeltCurvature>`
`getAllPossibleCurvatureMethods()`

`static double`
```mengerDC(double[] x, double[] y, int i)```

• ## Field Details

• ### MAX_SLOPE

static final MeltCurvature MAX_SLOPE
Computes the y values where the maximum slope is detected (the highest difference of y values). Does not work well for large data.
• ### MIN_SLOPE

static final MeltCurvature MIN_SLOPE
Computes the y values where the minimum slope is detected (the lowest difference of y values). Does not work well for large data.
• ### MAX_SECOND_DERIVATIVE

static final MeltCurvature MAX_SECOND_DERIVATIVE
Compute the y value of the elbow point (the point with the maximum absolute second derivative). https://stackoverflow.com/a/4473065/11951900 Does not work well for large data.
• ### MIN_SECOND_DERIVATIVE

static final MeltCurvature MIN_SECOND_DERIVATIVE
Compute the y value where the second derivative has the smallest value.
• ### MEDIAN

static final MeltCurvature MEDIAN
Compute the median value (e.g. taking the value which lies in the middle).
• ### MENGER_ELBOW

static final MeltCurvature MENGER_ELBOW
Menger curvature to detect elbow points. Implementation details also available at MengerCurvature.java. Paper from X. Tolsa, “Principal Values for the Cauchy Integral and Rectifiability,” in American Mathematical Society, 2000.
• ### MENGER_KNEE

static final MeltCurvature MENGER_KNEE
Menger curvature to detect knee points. Implementation details also available at MengerCurvature.java. Paper from X. Tolsa, “Principal Values for the Cauchy Integral and Rectifiability,” in American Mathematical Society, 2000.
• ### LONGEST_DISTANCE_TO_STRAIT_LINE_KNEE

static final MeltCurvature LONGEST_DISTANCE_TO_STRAIT_LINE_KNEE
• ### LONGEST_DISTANCE_TO_STRAIT_LINE_ELBOW

static final MeltCurvature LONGEST_DISTANCE_TO_STRAIT_LINE_ELBOW

• ### L_METHOD_KNEE

static final MeltCurvature L_METHOD_KNEE
Implementation of the L method from: S. Salvador and P. Chan, “Determining the Number of Clusters/Segments in Hierarchical Clustering/Segmentation Algorithms,” in ICTAI, 2004. Two regression lines which should fit best to the data. The intersection point is the knee. Implementation details from Lmethod.java.
• ### L_METHOD_ELBOW

static final MeltCurvature L_METHOD_ELBOW
Implementation of the L method from: S. Salvador and P. Chan, “Determining the Number of Clusters/Segments in Hierarchical Clustering/Segmentation Algorithms,” in ICTAI, 2004. Two regression lines which should fit best to the data. The intersection point is the elbow. The data is just reversed. Implementation details from Lmethod.java.
• ### KNEEDLE_ELBOW

static final MeltCurvature KNEEDLE_ELBOW
Implementation of "Finding a Kneedle in a Haystack: Detecting Knee Points in System Behavior" by Ville Satopaa; Jeannie Albrecht; David Irwin; Barath Raghavan. Partially used from library 137-stopmove.
• ## Method Details

• ### computeCurvature

double computeCurvature(double[] xVals, double[] yVals)
Computes the y value where the curvature changes. It returns the y value and not the x value. IMPORTANT: in case the values are sorted, it has to be ascending.
Parameters:
`xVals` - the x values
`yVals` - the y values
Returns:
the y value where the curvature changes
• ### computeCurvature

default double computeCurvature(double[] yVals)
• ### mengerDC

static double mengerDC(double[] x, double[] y, int i)
• ### configureLongestDistanceToStraightLine

static MeltCurvature configureLongestDistanceToStraightLine(boolean knee, double percentageDiff)
• ### getAllPossibleCurvatureMethods

static  getAllPossibleCurvatureMethods()