Class Beta
java.lang.Object
eduni.distributions.Generator
eduni.distributions.Beta
- All Implemented Interfaces:
ContinuousGenerator,Seedable
- Direct Known Subclasses:
BetaPrime
A random number generator based on the beta distribution.
-
Field Details
-
shape_a
protected double shape_a -
shape_b
protected double shape_b
-
-
Constructor Details
-
Beta
public Beta(double shape_a, double shape_b) the seed is automatically provided by theSeedGenerator- Parameters:
shape_a- The a shape parameter of the distributionshape_b- The b shape parameter of the distribution
-
Beta
public Beta(double shape_a, double shape_b, long seed) The constructor with which a specific seed is set for the random number generator- Parameters:
shape_a- The a shape parameter of the distributionshape_b- The b shape parameter of the distributionseed- The initial seed for the generator, two instances with the same seed will generate the same sequence of numbers
-
-
Method Details
-
sample
public double sample()Generate a new random number.- Specified by:
samplein interfaceContinuousGenerator- Returns:
- The next random number in the sequence
-