weka.core
Class SpecialFunctions
java.lang.Object
|
+--weka.core.SpecialFunctions
- public final class SpecialFunctions
- extends java.lang.Object
Class implementing some mathematical functions.
- Author:
- Eibe Frank (eibe@cs.waikato.ac.nz)
Method Summary |
static double |
lnFactorial(double x)
Returns natural logarithm of factorial using gamma function. |
static double |
lnGamma(double x)
Returns natural logarithm of gamma function. |
static double |
log2Binomial(double a,
double b)
Returns base 2 logarithm of binomial coefficient using gamma function. |
static double |
log2Multinomial(double a,
double[] bs)
Returns base 2 logarithm of multinomial using gamma function. |
static void |
main(java.lang.String[] ops)
Main method for testing this class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SpecialFunctions
public SpecialFunctions()
lnFactorial
public static double lnFactorial(double x)
- Returns natural logarithm of factorial using gamma function.
- Parameters:
x
- the value- Returns:
- natural logarithm of factorial
lnGamma
public static double lnGamma(double x)
- Returns natural logarithm of gamma function. Converted to java
from Numerical Recipes in C.
- Parameters:
x
- the value- Returns:
- natural logarithm of gamma function
log2Binomial
public static double log2Binomial(double a,
double b)
throws java.lang.ArithmeticException
- Returns base 2 logarithm of binomial coefficient using gamma function.
- Parameters:
a
- upper part of binomial coefficientb
- lower part- Returns:
- the base 2 logarithm of the binominal coefficient a over b
log2Multinomial
public static double log2Multinomial(double a,
double[] bs)
throws java.lang.ArithmeticException
- Returns base 2 logarithm of multinomial using gamma function.
- Parameters:
a
- upper part of multinomial coefficientbs
- lower part- Returns:
- multinomial coefficient of a over the bs
main
public static void main(java.lang.String[] ops)
- Main method for testing this class.