Package weka.core
Class SpecialFunctions
java.lang.Object
weka.core.SpecialFunctions
- All Implemented Interfaces:
RevisionHandler
Class implementing some mathematical functions.
- Version:
- $Revision: 14911 $
- Author:
- Eibe Frank (eibe@cs.waikato.ac.nz)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the revision string.static double
lnFactorial
(double x) Returns natural logarithm of factorial using 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 method for testing this class.
-
Constructor Details
-
SpecialFunctions
public SpecialFunctions()
-
-
Method Details
-
lnFactorial
public static double lnFactorial(double x) Returns natural logarithm of factorial using gamma function.- Parameters:
x
- the value- Returns:
- natural logarithm of factorial
-
log2Binomial
public static double log2Binomial(double a, double b) 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) 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
-
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-
main
Main method for testing this class.
-