8 Probability Distributions8.1 OverviewStandard distributions are now available in the Commons Statistics component. Commons Math provides
Inverse distribution functions can be computed using the
X is distributed as f.For discrete f, the definition is the same, with Z (the integers)
in place of R. Note that in the discrete case, the ≥ in the definition
can make a difference when p is an attained value of the distribution.
8.2 Generating data like an input file
Using the
double[] input = load("data.txt"); // Get some data.
int binCount = 500;
EmpiricalDistribution empDist = EmpiricalDistribution.from(binCount, input);
ContinuousDistribution.Sampler sampler = empDist.createSampler(RandomSource.MT.create());
double value = sampler.nextDouble(); |