Package org.drip.sequence.random
Class Binary
java.lang.Object
org.drip.sequence.random.UnivariateSequenceGenerator
org.drip.sequence.random.Bounded
org.drip.sequence.random.Binary
public class Binary extends Bounded
Binary implements the Standard {0, 1}-valued Binary Random Number Generator.
- Module = Numerical Core Module
- Library = Statistical Learning Library
- Project = Sequence
- Package = Random
- Author:
- Lakshmi Krishnamurthy
-
Constructor Summary
Constructors Constructor Description Binary(double dblPositiveProbability)
Binary Distribution Constructor -
Method Summary
Modifier and Type Method Description double
positiveProbability()
Retrieve the Positive Instance Probabilitydouble
random()
Generate a Random Number according to the specified ruleMethods inherited from class org.drip.sequence.random.Bounded
lowerBound, sequence, upperBound
Methods inherited from class org.drip.sequence.random.UnivariateSequenceGenerator
sequence
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Binary
public Binary(double dblPositiveProbability) throws java.lang.ExceptionBinary Distribution Constructor- Parameters:
dblPositiveProbability
- Probability of Generating ONE- Throws:
java.lang.Exception
- Thrown if the Inputs are invalid
-
-
Method Details
-
positiveProbability
public double positiveProbability()Retrieve the Positive Instance Probability- Returns:
- The Positive Instance Probability
-
random
public double random()Description copied from class:UnivariateSequenceGenerator
Generate a Random Number according to the specified rule- Specified by:
random
in classUnivariateSequenceGenerator
- Returns:
- The Random Number
-