/** {@inheritDoc} */ public double cumulativeProbability(double x) { if (x <= 0) { return 0; } else if (x >= 1) { return 1; } else { return Beta.regularizedBeta(x, alpha, beta); } }
@Override public double cumulativeProbability(double x) { double ret; if (x < 0) { ret = 0.0D; } else if (x >= this.numberOfTrials) { ret = 1.0D; } else { ret = 1.0D - Beta.regularizedBeta(this.probabilityOfSuccess, x + 1.0D, (this.numberOfTrials - x)); } return ret; }
/** {@inheritDoc} */ public double cumulativeProbability(int x) { double ret; if (x < 0) { ret = 0.0; } else { ret = Beta.regularizedBeta(probabilityOfSuccess, numberOfSuccesses, x + 1.0); } return ret; }
/** {@inheritDoc} */ public double cumulativeProbability(int x) { double ret; if (x < 0) { ret = 0.0; } else if (x >= numberOfTrials) { ret = 1.0; } else { ret = 1.0 - Beta.regularizedBeta(probabilityOfSuccess, x + 1.0, numberOfTrials - x); } return ret; }
/** * {@inheritDoc} */ public double cumulativeProbability(int x) { double ret; if (x < 0) { ret = 0.0; } else if (x >= numberOfTrials) { ret = 1.0; } else { ret = 1.0 - Beta.regularizedBeta(probabilityOfSuccess, x + 1.0, numberOfTrials - x); } return ret; }
/** * Returns the * <a href="http://mathworld.wolfram.com/RegularizedBetaFunction.html"> * regularized beta function</a> I(x, a, b). * * @param x Value. * @param a Parameter {@code a}. * @param b Parameter {@code b}. * @return the regularized beta function I(x, a, b). * @throws org.apache.commons.math3.exception.MaxCountExceededException * if the algorithm fails to converge. */ public static double regularizedBeta(double x, double a, double b) { return regularizedBeta(x, a, b, DEFAULT_EPSILON, Integer.MAX_VALUE); }
/** * Returns the regularized beta function I(x, a, b). * * @param x the value. * @param a Parameter {@code a}. * @param b Parameter {@code b}. * @param maxIterations Maximum number of "iterations" to complete. * @return the regularized beta function I(x, a, b) * @throws org.apache.commons.math3.exception.MaxCountExceededException * if the algorithm fails to converge. */ public static double regularizedBeta(double x, double a, double b, int maxIterations) { return regularizedBeta(x, a, b, DEFAULT_EPSILON, maxIterations); }
/** * Returns the * <a href="http://mathworld.wolfram.com/RegularizedBetaFunction.html"> * regularized beta function</a> I(x, a, b). * * @param x Value. * @param a Parameter {@code a}. * @param b Parameter {@code b}. * @param epsilon When the absolute value of the nth item in the * series is less than epsilon the approximation ceases to calculate * further elements in the series. * @return the regularized beta function I(x, a, b) * @throws org.apache.commons.math3.exception.MaxCountExceededException * if the algorithm fails to converge. */ public static double regularizedBeta(double x, double a, double b, double epsilon) { return regularizedBeta(x, a, b, epsilon, Integer.MAX_VALUE); }
/** {@inheritDoc} */ public double cumulativeProbability(double x) { double ret; if (x == 0) { ret = 0.5; } else { double t = Beta.regularizedBeta( degreesOfFreedom / (degreesOfFreedom + (x * x)), 0.5 * degreesOfFreedom, 0.5); if (x < 0.0) { ret = 0.5 * t; } else { ret = 1.0 - 0.5 * t; } } return ret; }
/** * {@inheritDoc} * * The implementation of this method is based on * <ul> * <li> * <a href="http://mathworld.wolfram.com/F-Distribution.html"> * F-Distribution</a>, equation (4). * </li> * </ul> */ public double cumulativeProbability(double x) { double ret; if (x <= 0) { ret = 0; } else { double n = numeratorDegreesOfFreedom; double m = denominatorDegreesOfFreedom; ret = Beta.regularizedBeta((n * x) / (m + n * x), 0.5 * n, 0.5 * m); } return ret; }
} else if (x > (a + 1) / (2 + b + a) && 1 - x <= (b + 1) / (2 + b + a)) { ret = 1 - regularizedBeta(1 - x, b, a, epsilon, maxIterations); } else { ContinuedFraction fraction = new ContinuedFraction() {
/** {@inheritDoc} */ public double cumulativeProbability(int x) { double ret; if (x < 0) { ret = 0.0; } else { ret = Beta.regularizedBeta(probabilityOfSuccess, numberOfSuccesses, x + 1.0); } return ret; }
/** {@inheritDoc} */ public double cumulativeProbability(double x) { if (x <= 0) { return 0; } else if (x >= 1) { return 1; } else { return Beta.regularizedBeta(x, alpha, beta); } }
/** {@inheritDoc} */ public double cumulativeProbability(int x) { double ret; if (x < 0) { ret = 0.0; } else if (x >= numberOfTrials) { ret = 1.0; } else { ret = 1.0 - Beta.regularizedBeta(probabilityOfSuccess, x + 1.0, numberOfTrials - x); } return ret; }
/** {@inheritDoc} */ public double cumulativeProbability(int x) { double ret; if (x < 0) { ret = 0.0; } else if (x >= numberOfTrials) { ret = 1.0; } else { ret = 1.0 - Beta.regularizedBeta(probabilityOfSuccess, x + 1.0, numberOfTrials - x); } return ret; }
/** {@inheritDoc} */ public double cumulativeProbability(int x) { double ret; if (x < 0) { ret = 0.0; } else { ret = Beta.regularizedBeta(probabilityOfSuccess, numberOfSuccesses, x + 1.0); } return ret; }
/** {@inheritDoc} */ public double cumulativeProbability(double x) { if (x <= 0) { return 0; } else if (x >= 1) { return 1; } else { return Beta.regularizedBeta(x, alpha, beta); } }
@Override public double cumulativeProbability(double x) { double ret; if (x < 0) { ret = 0.0D; } else if (x >= this.numberOfTrials) { ret = 1.0D; } else { ret = 1.0D - Beta.regularizedBeta(this.probabilityOfSuccess, x + 1.0D, (this.numberOfTrials - x)); } return ret; }
/** * Returns the * <a href="http://mathworld.wolfram.com/RegularizedBetaFunction.html"> * regularized beta function</a> I(x, a, b). * * @param x Value. * @param a Parameter {@code a}. * @param b Parameter {@code b}. * @return the regularized beta function I(x, a, b). * @throws org.apache.commons.math3.exception.MaxCountExceededException * if the algorithm fails to converge. */ public static double regularizedBeta(double x, double a, double b) { return regularizedBeta(x, a, b, DEFAULT_EPSILON, Integer.MAX_VALUE); }
/** * Returns the regularized beta function I(x, a, b). * * @param x the value. * @param a Parameter {@code a}. * @param b Parameter {@code b}. * @param maxIterations Maximum number of "iterations" to complete. * @return the regularized beta function I(x, a, b) * @throws org.apache.commons.math3.exception.MaxCountExceededException * if the algorithm fails to converge. */ public static double regularizedBeta(double x, double a, double b, int maxIterations) { return regularizedBeta(x, a, b, DEFAULT_EPSILON, maxIterations); }