org.apache.commons.math.random
Class EmpiricalDistributionImpl

java.lang.Object
  extended byorg.apache.commons.math.random.EmpiricalDistributionImpl
All Implemented Interfaces:
EmpiricalDistribution, Serializable

public class EmpiricalDistributionImpl
extends Object
implements Serializable, EmpiricalDistribution

Implements EmpiricalDistribution interface. This implementation uses what amounts to the Variable Kernel Method with Gaussian smoothing:

Digesting the input file

  1. Pass the file once to compute min and max.
  2. Divide the range from min-max into binCount "bins."
  3. Pass the data file again, computing bin counts and univariate statistics (mean, std dev.) for each of the bins
  4. Divide the interval (0,1) into subintervals associated with the bins, with the length of a bin's subinterval proportional to its count.
Generating random values from the distribution
  1. Generate a uniformly distributed value in (0,1)
  2. Select the subinterval to which the value belongs.
  3. Generate a random Gaussian value with mean = mean of the associated bin and std dev = std dev of associated bin.

USAGE NOTES: