org.apache.commons.math3.distribution
final class SaddlePointExpansion extends java.lang.Object
Utility class used by various distributions to accurately compute their respective probability mass functions. The implementation for this class is based on the Catherine Loader's dbinom routines.
This class is not intended to be called directly.
References:
Modifier and Type | Field and Description |
---|---|
private static double[] |
EXACT_STIRLING_ERRORS
exact Stirling expansion error for certain values.
|
private static double |
HALF_LOG_2_PI
1/2 * log(2 π).
|
Modifier | Constructor and Description |
---|---|
private |
SaddlePointExpansion()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
(package private) static double |
getDeviancePart(double x,
double mu)
A part of the deviance portion of the saddle point approximation.
|
(package private) static double |
getStirlingError(double z)
Compute the error of Stirling's series at the given value.
|
(package private) static double |
logBinomialProbability(int x,
int n,
double p,
double q)
Compute the logarithm of the PMF for a binomial distribution
using the saddle point expansion.
|
private static final double HALF_LOG_2_PI
private static final double[] EXACT_STIRLING_ERRORS
static double getStirlingError(double z)
References:
z
- the value.static double getDeviancePart(double x, double mu)
References:
x
- the x value.mu
- the average.static double logBinomialProbability(int x, int n, double p, double q)
x
- the value at which the probability is evaluated.n
- the number of trials.p
- the probability of success.q
- the probability of failure (1 - p).Copyright (c) 2003-2013 Apache Software Foundation