jhplot.math.num.random
Class GeometricRandomVariable
- java.lang.Object
-
- jhplot.math.num.random.AbstractDiscreteRandomVariable
-
- jhplot.math.num.random.GeometricRandomVariable
-
- All Implemented Interfaces:
- DiscreteRandomVariable
public class GeometricRandomVariable extends AbstractDiscreteRandomVariable
A random variable generator for the Geometric distribution.
References:
- Wikipedia contributors, "Geometric Distribution," Wikipedia, The Free Encyclopedia, http://en.wikipedia.org/wiki/Geometric_distribution
- Since:
- 1.3
-
-
Constructor Summary
Constructors Constructor and Description GeometricRandomVariable()
Default constructor.GeometricRandomVariable(double p)
Create a random variable with the given probability of success.GeometricRandomVariable(double p, RNG source)
Create a random variable with the given parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description int
nextRandomVariable()
Access the next random variable from this generator.static int
nextRandomVariable(double p, RNG source)
Access the next random variable using the given generator.
-
-
-
Constructor Detail
-
GeometricRandomVariable
public GeometricRandomVariable()
Default constructor. Probability of success is set to 0.5.
-
GeometricRandomVariable
public GeometricRandomVariable(double p)
Create a random variable with the given probability of success.- Parameters:
p
- the probability of success.
-
GeometricRandomVariable
public GeometricRandomVariable(double p, RNG source)
Create a random variable with the given parameters.- Parameters:
p
- the probability of success.source
- the source generator.
-
-
Method Detail
-
nextRandomVariable
public static int nextRandomVariable(double p, RNG source)
Access the next random variable using the given generator.- Parameters:
p
- the probability of success.source
- the source generator.- Returns:
- the next random variable.
-
nextRandomVariable
public int nextRandomVariable()
Access the next random variable from this generator.- Returns:
- the next random variable.
-
-
DMelt 3.0 © DataMelt by jWork.ORG