|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.math.MathUtil
public class MathUtil
A collection of math related utility functions.
Constructor Summary | |
---|---|
MathUtil()
|
Method Summary | ||
---|---|---|
static double |
binomialCoefficient(int n,
int k)
Binomial coefficent, also known as "n choose k") |
|
static double |
factorial(int n)
Compute the Factorial of n, often written as c! |
|
static double |
hypotenuse(double a,
double b)
Computes the square root of the sum of the squared arguments without under or overflow. |
|
static double |
mahalanobisDistance(Matrix weightMatrix,
Vector o1_minus_o2)
Compute the Mahalanobis distance using the given weight matrix |
|
static double |
normalCDF(double x,
double mu,
double sigma)
Cumulative probability density function (CDF) of a normal distribution. |
|
static double |
normalPDF(double x,
double mu,
double sigma)
Probability density function of the normal distribution. |
|
static
|
pearsonCorrelationCoefficient(NumberVector<V,?> x,
NumberVector<V,?> y)
Provides the Pearson product-moment correlation coefficient for two FeatureVectors. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MathUtil()
Method Detail |
---|
public static double hypotenuse(double a, double b)
a
- first cathetusb
- second cathetus
sqrt(a<sup>2</sup> + b<sup>2</sup>)
public static double mahalanobisDistance(Matrix weightMatrix, Vector o1_minus_o2)
weightMatrix
- Weight Matrixo1_minus_o2
- Delta vector
public static <V extends NumberVector<V,N>,N extends Number> double pearsonCorrelationCoefficient(NumberVector<V,?> x, NumberVector<V,?> y)
Provides the Pearson product-moment correlation coefficient for two FeatureVectors.
V
- type of the FeatureVectorsN
- type of the numerical attributes of the FeatureVectors of type Vx
- first FeatureVectory
- second FeatureVector
public static double factorial(int n)
c!
in
mathematics.
n
- Note: n >= 0
public static double binomialCoefficient(int n, int k)
Binomial coefficent, also known as "n choose k")
n
- Total number of samples. n > 0k
- Number of elements to choose. n >= k
,
k >= 0
public static double normalPDF(double x, double mu, double sigma)
1/(SQRT(2*pi*sigma^2)) * e^(-(x-mu)^2/2sigma^2)
x
- The value.mu
- The mean.sigma
- The standard deviation.
public static double normalCDF(double x, double mu, double sigma)
x
- value to evaluate CDF atmu
- Mean valuesigma
- Standard deviation.
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |