Package org.ojalgo.random
Class Binomial
- java.lang.Object
-
- org.ojalgo.random.RandomNumber
-
- org.ojalgo.random.AbstractDiscrete
-
- org.ojalgo.random.Binomial
-
- All Implemented Interfaces:
java.lang.Comparable<RandomNumber>
,java.util.function.DoubleSupplier
,java.util.function.Supplier<java.lang.Double>
,BasicFunction
,NullaryFunction<java.lang.Double>
,PrimitiveFunction.Nullary
,DiscreteDistribution
,Distribution
,AccessScalar<java.lang.Double>
,ComparableNumber<RandomNumber>
,NumberDefinition
public class Binomial extends AbstractDiscrete
The frequency in count indepedent trials, each with probability probability, has a binomial distribution.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ojalgo.function.BasicFunction
BasicFunction.Differentiable<N extends java.lang.Comparable<N>,F extends BasicFunction>, BasicFunction.Integratable<N extends java.lang.Comparable<N>,F extends BasicFunction>, BasicFunction.PlainUnary<T,R>
-
-
Field Summary
Fields Modifier and Type Field Description private int
myCount
private double
myProbability
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
generate()
double
getExpected()
double
getProbability(int value)
Probability density functiondouble
getVariance()
Subclasses must override either getStandardDeviation() or getVariance()!static Binomial
of(int count, double probability)
-
Methods inherited from class org.ojalgo.random.RandomNumber
checkProbabilty, compareTo, doubleValue, floatValue, getStandardDeviation, intValue, invoke, longValue, newSampleSet, random, setRandom, setSeed, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ojalgo.random.Distribution
getStandardDeviation
-
Methods inherited from interface org.ojalgo.function.NullaryFunction
andThen, get, getAsDouble
-
Methods inherited from interface org.ojalgo.type.NumberDefinition
booleanValue, byteValue, shortValue
-
-
-
-
Method Detail
-
of
public static Binomial of(int count, double probability)
-
getExpected
public double getExpected()
-
getProbability
public double getProbability(int value)
Description copied from interface:DiscreteDistribution
Probability density function
-
getVariance
public double getVariance()
Description copied from class:RandomNumber
Subclasses must override either getStandardDeviation() or getVariance()!- Specified by:
getVariance
in interfaceDistribution
- Overrides:
getVariance
in classRandomNumber
- See Also:
Distribution.getStandardDeviation()
,Distribution.getVariance()
-
generate
protected double generate()
- Specified by:
generate
in classRandomNumber
-
-