commonSense.math.linear
Class Distances

java.lang.Object
  extended bycommonSense.math.linear.Distances

public class Distances
extends java.lang.Object


Method Summary
static double[] euclidean(Matrix a)
          Calculates the euclidean distance of a sample, and returns the non-squared distance.
static double[] mahalanobis(Matrix a)
          Calculates the mahalanobis distance of a sample, and returns the non-squared distance.
static double[] mahalanobis(Matrix a, Matrix covar)
          Calculates the mahalanobis distance of a sample, and returns the non-squared distance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

mahalanobis

public static double[] mahalanobis(Matrix a,
                                   Matrix covar)
Calculates the mahalanobis distance of a sample, and returns the non-squared distance.

Parameters:
a - The matrix of which the distances need to be calculated.
covar - The covariance matrix of matrix 'a' to avoid duplication of calculation efforts.

mahalanobis

public static double[] mahalanobis(Matrix a)
Calculates the mahalanobis distance of a sample, and returns the non-squared distance.

Parameters:
a - The matrix of which the distances need to be calculated.

euclidean

public static double[] euclidean(Matrix a)
Calculates the euclidean distance of a sample, and returns the non-squared distance.

Parameters:
a - The matrix of which the distances need to be calculated.


RealJ version 3.5 2001. www.realj.com