@Test public void testSimpleDist() { RandomUtils.useTestSeed(); Empirical z = new Empirical(true, true, 3, 0, 1, 0.5, 2, 1, 3.0); List<Double> r = Lists.newArrayList(); for (int i = 0; i < 10001; i++) { r.add(z.sample()); } Collections.sort(r); assertEquals(2.0, r.get(5000), 0.15); }
@Override public Double sample() { return sample(gen.nextDouble()); }
Empirical extends AbstractSamplerFunction { @Override public Double sample() { return sample(gen.nextDouble()); } }
Empirical extends AbstractSamplerFunction { @Override public Double sample() { return sample(gen.nextDouble()); } Empirical(boolean exceedMinimum, boolean exceedMaximum, int samples, double... ecdf); }
Empirical extends AbstractSamplerFunction { @Override public Double sample() { return sample(gen.nextDouble()); } Empirical(boolean exceedMinimum, boolean exceedMaximum, int samples, double... ecdf); @Override Double sample(); double sample(double u); }
Empirical extends AbstractSamplerFunction { @Override public Double sample() { return sample(gen.nextDouble()); } Empirical(boolean exceedMinimum, boolean exceedMaximum, int samples, double... ecdf); @Override Double sample(); double sample(double u);  }