Java Code Examples for org.apache.commons.math.util.MathUtils#binomialCoefficientDouble()
The following examples show how to use
org.apache.commons.math.util.MathUtils#binomialCoefficientDouble() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PascalDistributionImpl.java From astor with GNU General Public License v2.0 | 5 votes |
/** * For this distribution, X, this method returns P(X = x). * @param x the value at which the PMF is evaluated * @return PMF for this distribution */ public double probability(int x) { double ret; if (x < 0) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble(x + getNumberOfSuccesses() - 1, getNumberOfSuccesses() - 1) * Math.pow(getProbabilityOfSuccess(), getNumberOfSuccesses()) * Math.pow(1.0 - getProbabilityOfSuccess(), x); } return ret; }
Example 2
Source File: PascalDistributionImpl.java From astor with GNU General Public License v2.0 | 5 votes |
/** * For this distribution, X, this method returns P(X = x). * * @param x the value at which the PMF is evaluated * @return PMF for this distribution */ public double probability(int x) { double ret; if (x < 0) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble(x + getNumberOfSuccesses() - 1, getNumberOfSuccesses() - 1) * Math.pow(getProbabilityOfSuccess(), getNumberOfSuccesses()) * Math.pow(1.0 - getProbabilityOfSuccess(), x); } return ret; }
Example 3
Source File: BinomialDistributionImpl.java From astor with GNU General Public License v2.0 | 5 votes |
/** * For this distribution, X, this method returns P(X = x). * * @param x the value at which the PMF is evaluated. * @return PMF for this distribution. */ public double probability(int x) { double ret; if (x < 0 || x > getNumberOfTrials()) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble( getNumberOfTrials(), x) * Math.pow(getProbabilityOfSuccess(), x) * Math.pow(1.0 - getProbabilityOfSuccess(), getNumberOfTrials() - x); } return ret; }
Example 4
Source File: PascalDistributionImpl.java From astor with GNU General Public License v2.0 | 5 votes |
/** * For this distribution, X, this method returns P(X = x). * @param x the value at which the PMF is evaluated * @return PMF for this distribution */ public double probability(int x) { double ret; if (x < 0) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble(x + getNumberOfSuccesses() - 1, getNumberOfSuccesses() - 1) * Math.pow(getProbabilityOfSuccess(), getNumberOfSuccesses()) * Math.pow(1.0 - getProbabilityOfSuccess(), x); } return ret; }
Example 5
Source File: BinomialDistributionImpl.java From astor with GNU General Public License v2.0 | 5 votes |
/** * For this distribution, X, this method returns P(X = x). * * @param x the value at which the PMF is evaluated. * @return PMF for this distribution. */ public double probability(int x) { double ret; if (x < 0 || x > getNumberOfTrials()) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble( getNumberOfTrials(), x) * Math.pow(getProbabilityOfSuccess(), x) * Math.pow(1.0 - getProbabilityOfSuccess(), getNumberOfTrials() - x); } return ret; }
Example 6
Source File: PascalDistributionImpl.java From astor with GNU General Public License v2.0 | 5 votes |
/** * For this distribution, X, this method returns P(X = x). * @param x the value at which the PMF is evaluated * @return PMF for this distribution */ public double probability(int x) { double ret; if (x < 0) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble(x + getNumberOfSuccesses() - 1, getNumberOfSuccesses() - 1) * Math.pow(getProbabilityOfSuccess(), getNumberOfSuccesses()) * Math.pow(1.0 - getProbabilityOfSuccess(), x); } return ret; }
Example 7
Source File: BinomialDistributionImpl.java From astor with GNU General Public License v2.0 | 5 votes |
/** * For this distribution, X, this method returns P(X = x). * * @param x the value at which the PMF is evaluated. * @return PMF for this distribution. */ public double probability(int x) { double ret; if (x < 0 || x > getNumberOfTrials()) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble( getNumberOfTrials(), x) * Math.pow(getProbabilityOfSuccess(), x) * Math.pow(1.0 - getProbabilityOfSuccess(), getNumberOfTrials() - x); } return ret; }
Example 8
Source File: PascalDistributionImpl.java From astor with GNU General Public License v2.0 | 5 votes |
/** * For this distribution, X, this method returns P(X = x). * @param x the value at which the PMF is evaluated * @return PMF for this distribution */ public double probability(int x) { double ret; if (x < 0) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble(x + getNumberOfSuccesses() - 1, getNumberOfSuccesses() - 1) * Math.pow(getProbabilityOfSuccess(), getNumberOfSuccesses()) * Math.pow(1.0 - getProbabilityOfSuccess(), x); } return ret; }
Example 9
Source File: PascalDistributionImpl.java From astor with GNU General Public License v2.0 | 5 votes |
/** * For this distribution, {@code X}, this method returns {@code P(X = x)}. * * @param x Value at which the PMF is evaluated. * @return PMF for this distribution. */ public double probability(int x) { double ret; if (x < 0) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble(x + numberOfSuccesses - 1, numberOfSuccesses - 1) * FastMath.pow(probabilityOfSuccess, numberOfSuccesses) * FastMath.pow(1.0 - probabilityOfSuccess, x); } return ret; }
Example 10
Source File: PascalDistributionImpl.java From astor with GNU General Public License v2.0 | 5 votes |
/** * For this distribution, X, this method returns P(X = x). * @param x the value at which the PMF is evaluated * @return PMF for this distribution */ public double probability(int x) { double ret; if (x < 0) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble(x + numberOfSuccesses - 1, numberOfSuccesses - 1) * Math.pow(probabilityOfSuccess, numberOfSuccesses) * Math.pow(1.0 - probabilityOfSuccess, x); } return ret; }
Example 11
Source File: PascalDistributionImpl.java From cacheonix-core with GNU Lesser General Public License v2.1 | 5 votes |
/** * For this distribution, X, this method returns P(X = x). * @param x the value at which the PMF is evaluated * @return PMF for this distribution */ public double probability(int x) { double ret; if (x < 0) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble(x + getNumberOfSuccesses() - 1, getNumberOfSuccesses() - 1) * Math.pow(getProbabilityOfSuccess(), getNumberOfSuccesses()) * Math.pow(1.0 - getProbabilityOfSuccess(), x); } return ret; }
Example 12
Source File: PascalDistributionImpl.java From astor with GNU General Public License v2.0 | 5 votes |
/** * For this distribution, X, this method returns P(X = x). * @param x the value at which the PMF is evaluated * @return PMF for this distribution */ public double probability(int x) { double ret; if (x < 0) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble(x + numberOfSuccesses - 1, numberOfSuccesses - 1) * Math.pow(probabilityOfSuccess, numberOfSuccesses) * Math.pow(1.0 - probabilityOfSuccess, x); } return ret; }
Example 13
Source File: PascalDistributionImpl.java From astor with GNU General Public License v2.0 | 5 votes |
/** * For this distribution, X, this method returns P(X = x). * @param x the value at which the PMF is evaluated * @return PMF for this distribution */ public double probability(int x) { double ret; if (x < 0) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble(x + numberOfSuccesses - 1, numberOfSuccesses - 1) * Math.pow(probabilityOfSuccess, numberOfSuccesses) * Math.pow(1.0 - probabilityOfSuccess, x); } return ret; }
Example 14
Source File: PascalDistributionImpl.java From astor with GNU General Public License v2.0 | 5 votes |
/** * For this distribution, X, this method returns P(X = x). * @param x the value at which the PMF is evaluated * @return PMF for this distribution */ public double probability(int x) { double ret; if (x < 0) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble(x + numberOfSuccesses - 1, numberOfSuccesses - 1) * Math.pow(probabilityOfSuccess, numberOfSuccesses) * Math.pow(1.0 - probabilityOfSuccess, x); } return ret; }
Example 15
Source File: PascalDistributionImpl.java From astor with GNU General Public License v2.0 | 5 votes |
/** * For this distribution, X, this method returns P(X = x). * @param x the value at which the PMF is evaluated * @return PMF for this distribution */ public double probability(int x) { double ret; if (x < 0) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble(x + getNumberOfSuccesses() - 1, getNumberOfSuccesses() - 1) * Math.pow(getProbabilityOfSuccess(), getNumberOfSuccesses()) * Math.pow(1.0 - getProbabilityOfSuccess(), x); } return ret; }
Example 16
Source File: PascalDistributionImpl.java From astor with GNU General Public License v2.0 | 5 votes |
/** * For this distribution, {@code X}, this method returns {@code P(X = x)}. * * @param x Value at which the PMF is evaluated. * @return PMF for this distribution. */ public double probability(int x) { double ret; if (x < 0) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble(x + numberOfSuccesses - 1, numberOfSuccesses - 1) * FastMath.pow(probabilityOfSuccess, numberOfSuccesses) * FastMath.pow(1.0 - probabilityOfSuccess, x); } return ret; }
Example 17
Source File: BinomialDistributionImpl.java From astor with GNU General Public License v2.0 | 5 votes |
/** * For this disbution, X, this method returns P(X = x). * * @param x the value at which the PMF is evaluated. * @return PMF for this distribution. */ public double probability(int x) { double ret; if (x < 0 || x > getNumberOfTrials()) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble( getNumberOfTrials(), x) * Math.pow(getProbabilityOfSuccess(), x) * Math.pow(1.0 - getProbabilityOfSuccess(), getNumberOfTrials() - x); } return ret; }
Example 18
Source File: PascalDistributionImpl.java From astor with GNU General Public License v2.0 | 5 votes |
/** * For this distribution, {@code X}, this method returns {@code P(X = x)}. * * @param x Value at which the PMF is evaluated. * @return PMF for this distribution. */ public double probability(int x) { double ret; if (x < 0) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble(x + numberOfSuccesses - 1, numberOfSuccesses - 1) * FastMath.pow(probabilityOfSuccess, numberOfSuccesses) * FastMath.pow(1.0 - probabilityOfSuccess, x); } return ret; }
Example 19
Source File: PascalDistributionImpl.java From astor with GNU General Public License v2.0 | 5 votes |
/** * For this distribution, X, this method returns P(X = x). * @param x the value at which the PMF is evaluated * @return PMF for this distribution */ public double probability(int x) { double ret; if (x < 0) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble(x + getNumberOfSuccesses() - 1, getNumberOfSuccesses() - 1) * Math.pow(getProbabilityOfSuccess(), getNumberOfSuccesses()) * Math.pow(1.0 - getProbabilityOfSuccess(), x); } return ret; }
Example 20
Source File: BinomialDistributionImpl.java From cacheonix-core with GNU Lesser General Public License v2.1 | 5 votes |
/** * For this disbution, X, this method returns P(X = x). * * @param x the value at which the PMF is evaluated. * @return PMF for this distribution. */ public double probability(int x) { double ret; if (x < 0 || x > getNumberOfTrials()) { ret = 0.0; } else { ret = MathUtils.binomialCoefficientDouble( getNumberOfTrials(), x) * Math.pow(getProbabilityOfSuccess(), x) * Math.pow(1.0 - getProbabilityOfSuccess(), getNumberOfTrials() - x); } return ret; }