/** * Computes the empirical distribution using values from the file * in <code>valuesFileURL</code> and <code>binCount</code> bins. * <p> * <code>valuesFileURL</code> must exist and be readable by this process * at runtime.</p> * <p> * This method must be called before using <code>getNext()</code> * with <code>mode = DIGEST_MODE</code></p> * * @param binCount the number of bins used in computing the empirical * distribution * @throws NullArgumentException if the {@code valuesFileURL} has not been set * @throws IOException if an error occurs reading the input file * @throws ZeroException if URL contains no data */ public void computeDistribution(int binCount) throws NullArgumentException, IOException, ZeroException { empiricalDistribution = new EmpiricalDistribution(binCount, randomData.getRandomGenerator()); empiricalDistribution.load(valuesFileURL); mu = empiricalDistribution.getSampleStats().getMean(); sigma = empiricalDistribution.getSampleStats().getStandardDeviation(); }
/** * Computes the empirical distribution using values from the file * in <code>valuesFileURL</code> and <code>binCount</code> bins. * <p> * <code>valuesFileURL</code> must exist and be readable by this process * at runtime.</p> * <p> * This method must be called before using <code>getNext()</code> * with <code>mode = DIGEST_MODE</code></p> * * @param binCount the number of bins used in computing the empirical * distribution * @throws NullArgumentException if the {@code valuesFileURL} has not been set * @throws IOException if an error occurs reading the input file * @throws ZeroException if URL contains no data */ public void computeDistribution(int binCount) throws NullArgumentException, IOException, ZeroException { empiricalDistribution = new EmpiricalDistribution(binCount, randomData.getRandomGenerator()); empiricalDistribution.load(valuesFileURL); mu = empiricalDistribution.getSampleStats().getMean(); sigma = empiricalDistribution.getSampleStats().getStandardDeviation(); }