com.rapidminer.tools.math
Class MathFunctions

java.lang.Object
  extended by com.rapidminer.tools.math.MathFunctions

public class MathFunctions
extends java.lang.Object

This class provides mathematical functions not already provided by java.lang.Math:

Author:
Ralf Klinkenberg, Ingo Mierswa

Field Summary
protected static double[] DIVIDER_COEFFICIENTS_0
           
protected static double[] DIVIDER_COEFFICIENTS_1
           
protected static double[] DIVIDER_COEFFICIENTS_3
           
protected static double[] DIVISOR_COEFFICIENTS_0
          coefficients for polynomials used in normalInverse() to estimate normal distribution;
protected static double[] DIVISOR_COEFFICIENTS_1
           
protected static double[] DIVISOR_COEFFICIENTS_3
           
protected static double log2
           
 
Constructor Summary
MathFunctions()
           
 
Method Summary
static double correlation(double[] x1, double[] x2)
           
static double correlation(ExampleSet exampleSet, Attribute firstAttribute, Attribute secondAttribute, boolean squared)
          This method calculates the correlation between two (numerical) attributes of an example set.
static long getGCD(java.util.Collection<java.lang.Long> collection)
          Returns the greatest common divisor (GCD) of the given pair of values.
static long getGCD(long a, long b)
          Returns the greatest common divisor (GCD) of the given pair of values.
static double ld(double value)
          This method returns the logarithmus dualis from value
static double normalInverse(double probability)
          Returns the value x for which the area under the normal probability density function (integrated from minus infinity to this value x) is equal to the given probability.
static double robustMax(double m1, double m2)
           
static double robustMin(double m1, double m2)
           
static double solvePolynomial(double x, double[] coefficients)
          Solves a given polynomial at x.
static double tanh(double x)
          returns tangens hyperbolicus of x, i.e.
static double variance(double[] v, double a)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log2

protected static final double log2

DIVISOR_COEFFICIENTS_0

protected static final double[] DIVISOR_COEFFICIENTS_0
coefficients for polynomials used in normalInverse() to estimate normal distribution;


DIVIDER_COEFFICIENTS_0

protected static final double[] DIVIDER_COEFFICIENTS_0

DIVISOR_COEFFICIENTS_1

protected static final double[] DIVISOR_COEFFICIENTS_1

DIVIDER_COEFFICIENTS_1

protected static final double[] DIVIDER_COEFFICIENTS_1

DIVISOR_COEFFICIENTS_3

protected static final double[] DIVISOR_COEFFICIENTS_3

DIVIDER_COEFFICIENTS_3

protected static final double[] DIVIDER_COEFFICIENTS_3
Constructor Detail

MathFunctions

public MathFunctions()
Method Detail

tanh

public static double tanh(double x)
returns tangens hyperbolicus of x, i.e. y = tanh(x) = (e^x - e^-x) / (e^x + e^-x).


normalInverse

public static double normalInverse(double probability)
Returns the value x for which the area under the normal probability density function (integrated from minus infinity to this value x) is equal to the given probability. The normal distribution has mean of zero and variance of one.

Parameters:
probability - the area under the normal pdf
Returns:
x

solvePolynomial

public static double solvePolynomial(double x,
                                     double[] coefficients)
Solves a given polynomial at x. The polynomial is given by the coefficients. The coefficients are stored in natural order: coefficients[i] : c_i*x^i


variance

public static double variance(double[] v,
                              double a)
Parameters:
v - a vector values
a - a threeshold, only values greater equal this value are used in the calculation
Returns:
the variance

correlation

public static double correlation(ExampleSet exampleSet,
                                 Attribute firstAttribute,
                                 Attribute secondAttribute,
                                 boolean squared)
This method calculates the correlation between two (numerical) attributes of an example set.


correlation

public static double correlation(double[] x1,
                                 double[] x2)

robustMin

public static double robustMin(double m1,
                               double m2)

robustMax

public static double robustMax(double m1,
                               double m2)

ld

public static double ld(double value)
This method returns the logarithmus dualis from value

Parameters:
value - the value
Returns:
the log2 of value

getGCD

public static long getGCD(long a,
                          long b)
Returns the greatest common divisor (GCD) of the given pair of values.


getGCD

public static long getGCD(java.util.Collection<java.lang.Long> collection)
Returns the greatest common divisor (GCD) of the given pair of values.



Copyright © 2001-2009 by Rapid-I