Class MahalanobisDistance
java.lang.Object
simpaths.data.MahalanobisDistance
MahalanobisDistance is a class for computing the Mahalanobis distance
for a given data point with respect to a dataset.
The Mahalanobis distance measures the distance between a point and a
distribution of points, taking into account the correlation between
variables and the variance within each variable.
This class uses Apache Commons Math library to calculate the Mahalanobis
distance based on a provided dataset.
Usage:
1. Create an instance of MahalanobisDistance with your dataset.
2. Use the getMahalanobisDistance method to calculate the distance for
a given data point.
See MahalanobisDistanceTest for JUnit5 test cases
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetMahalanobisDistance(double[] pointToEvaluate) doublegetMahalanobisDistance(double[] point1, double[] point2)
-
Constructor Details
-
MahalanobisDistance
public MahalanobisDistance(double[][] data)
-
-
Method Details
-
getMahalanobisDistance
public double getMahalanobisDistance(double[] pointToEvaluate) -
getMahalanobisDistance
public double getMahalanobisDistance(double[] point1, double[] point2)
-