Random Numbers

numerics4j provides the means to generate random, floating-point numbers uniformly distributed between 0 and 1. Along with this basic functionality, numerics4j provides the means to generate random variables from many statistical distributions.

RNG

The core of numerics4j random number generating capabilities is centered around the RNG interface. This defines the interface for all the random number generators that produce random, floating-point numbers uniformly distributed between 0 and 1. The following core random number generators are provided by numerics4j:

Generator Description
LinearCongruentialRNG Generic linear congruential generator that can be constructed with arbitary modulus, multiplier, and shift parameters.
MathRNG Simple random number generator that delegates random number production to the java.lang.Math#random() method.
RandomRNG Simple random number generator that delegates random number production to a java.util.Random object.

Random Variables

numerics4j has the capability to generate random variables from many statistical distributions using standard techniques and algorithms. These techniques rely on a RNG instance as a source for random, floating-point numbers uniformly distributed between 0 and 1. Any RNG implementation can be utilized by the random variables include custom developed implementations. By default, an instance of RandomRNG is utilized. The following core random variable generators are provided by numerics4j:

DistributionClassParameters
Bernoulli BernoulliRandomVariable probability of success
Beta BetaRandomVariable
alpha
beta
Binomial BinomialRandomVariable
number of trials
probability of success
Cauchy CauchyRandomVariable
location
scale
Chi-Squared ChiSquaredRandomVariable degrees of freedom
Exponential ExponentialRandomVariable mean
F FRandomVariable
numerator degrees of freedom
denominator degrees of freedom
Gamma GammaRandomVariable
alpha
beta
Geometric GeometricRandomVariable probability of success
Laplace LaplaceRandomVariable
mean
scale
Logistic LogisticRandomVariable
mean
scale
Log Normal LogNormalRandomVariable
mean
standard deviation
Negative Binomial NegativeBinomialRandomVariable
number of successes
probability of success
Normal NormalRandomVariable
mean
standard deviation
Poisson PoissonRandomVariable mean
Rayleigh RayleighRandomVariable scale
t TRandomVariable degrees of freedom
Uniform UniformRandomVariable
lower bound
upper bound
Weibull WeibullRandomVariable
shape
scale
location