Package edu.cmu.tetrad.util
Class MathUtils
java.lang.Object
edu.cmu.tetrad.util.MathUtils
Some extra mathematical functions not contained in org.apache.commons.math3.util.FastMath.
- Version:
- $Id: $Id
- Author:
- josephramsey
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
choose
(int a, int b) choose.static int
factorial
(int n) factorial.static double
logChoose
(int a, int b) logChoose.static double
logFactorial
(int n) logFactorial.static double
logistic
(double x) logistic.
-
Method Details
-
logistic
public static double logistic(double x) logistic.
- Parameters:
x
- a double value.- Returns:
- the logistic function of x = 1 / (1 + exp(-x)).
-
factorial
public static int factorial(int n) factorial.
- Parameters:
n
- a int- Returns:
- a int
-
logFactorial
public static double logFactorial(int n) logFactorial.
- Parameters:
n
- a int- Returns:
- a double
-
choose
public static int choose(int a, int b) choose.
- Parameters:
a
- a intb
- a int- Returns:
- a int
-
logChoose
public static double logChoose(int a, int b) logChoose.
- Parameters:
a
- a intb
- a int- Returns:
- a double
-