Examples of cdf()


Examples of com.facebook.LinkBench.distributions.LogNormalDistribution.cdf()

    // Precomputed points
    d.init(0, 1000, 100, 1);
    assertEquals(0.033434, d.cdf(16), 0.0001);
    assertEquals(0.327695, d.cdf(64), 0.0001);
    assertEquals(0.597491, d.cdf(128), 0.0001);
    assertEquals(0.94878, d.cdf(512), 0.0001);
  }

  @Override
  public void testPDFSanity() {
View Full Code Here

Examples of com.facebook.LinkBench.distributions.LogNormalDistribution.cdf()

    // Precomputed points
    d.init(0, 1000, 100, 1);
    assertEquals(0.033434, d.cdf(16), 0.0001);
    assertEquals(0.327695, d.cdf(64), 0.0001);
    assertEquals(0.597491, d.cdf(128), 0.0001);
    assertEquals(0.94878, d.cdf(512), 0.0001);
  }

  @Override
  public void testPDFSanity() {
    System.err.println("test not implemented");
View Full Code Here

Examples of com.facebook.LinkBench.distributions.ProbabilityDistribution.cdf()

  public void testCDFSanity() {
    ProbabilityDistribution dist = getDist();
    long min = 453, max = 26546454;
    dist.init(min, max, getDistParams(), "");

    assertEquals(dist.cdf(min-1), 0.0);
    assertEquals(dist.cdf(min-234321), 0.0);
    assertEquals(dist.cdf(max), 1.0);
    assertEquals(dist.cdf(max+2343242224234L), 1.0);

    // Check cdf is monotonically increasing
View Full Code Here

Examples of com.facebook.LinkBench.distributions.ProbabilityDistribution.cdf()

    ProbabilityDistribution dist = getDist();
    long min = 453, max = 26546454;
    dist.init(min, max, getDistParams(), "");

    assertEquals(dist.cdf(min-1), 0.0);
    assertEquals(dist.cdf(min-234321), 0.0);
    assertEquals(dist.cdf(max), 1.0);
    assertEquals(dist.cdf(max+2343242224234L), 1.0);

    // Check cdf is monotonically increasing
    double last = 0.0;
View Full Code Here

Examples of com.facebook.LinkBench.distributions.ProbabilityDistribution.cdf()

    long min = 453, max = 26546454;
    dist.init(min, max, getDistParams(), "");

    assertEquals(dist.cdf(min-1), 0.0);
    assertEquals(dist.cdf(min-234321), 0.0);
    assertEquals(dist.cdf(max), 1.0);
    assertEquals(dist.cdf(max+2343242224234L), 1.0);

    // Check cdf is monotonically increasing
    double last = 0.0;
    long step = (max - min) / cdfChecks();
View Full Code Here

Examples of com.facebook.LinkBench.distributions.ProbabilityDistribution.cdf()

    dist.init(min, max, getDistParams(), "");

    assertEquals(dist.cdf(min-1), 0.0);
    assertEquals(dist.cdf(min-234321), 0.0);
    assertEquals(dist.cdf(max), 1.0);
    assertEquals(dist.cdf(max+2343242224234L), 1.0);

    // Check cdf is monotonically increasing
    double last = 0.0;
    long step = (max - min) / cdfChecks();
    for (long id = min; id < max; id += step) {
View Full Code Here

Examples of com.facebook.LinkBench.distributions.ProbabilityDistribution.cdf()

    // Check cdf is monotonically increasing
    double last = 0.0;
    long step = (max - min) / cdfChecks();
    for (long id = min; id < max; id += step) {
      double p = dist.cdf(id);
      assertTrue(p >= last);
      last = p;
    }
  }
View Full Code Here

Examples of com.facebook.LinkBench.distributions.ProbabilityDistribution.cdf()

    boolean fail = false;
    for (int b = 0; b < bucketCount; b++) {
      totalCount += buckets[b];
      long bucketTop = bucketer.bucketMax(b, n) + min;
      double actCDF = ((double)totalCount) / trials;
      double expCDF = dist.cdf(bucketTop);
      // 0.2% error
      if (Math.abs(expCDF - actCDF) > tolerance()) {
        System.err.println(String.format("Divergence between CDF and " +
            "choose function: P(X <= %d) act: %f exp: %f", bucketTop,
            actCDF, expCDF));
View Full Code Here

Examples of com.facebook.LinkBench.distributions.ProbabilityDistribution.cdf()

    ProbabilityDistribution dist = getDist();
    dist.init(min, max, getDistParams(), "");

    long step = (max - min) / cdfChecks();
    for (long id = min + 1; id < max; id += step) {
      double c = dist.cdf(id);
      double c1 = dist.cdf(id - 1);
      double p = dist.pdf(id);

      double err = Math.abs((c - c1) - p);
      if (err > 0.0001) {
View Full Code Here

Examples of com.facebook.LinkBench.distributions.ProbabilityDistribution.cdf()

    dist.init(min, max, getDistParams(), "");

    long step = (max - min) / cdfChecks();
    for (long id = min + 1; id < max; id += step) {
      double c = dist.cdf(id);
      double c1 = dist.cdf(id - 1);
      double p = dist.pdf(id);

      double err = Math.abs((c - c1) - p);
      if (err > 0.0001) {
        fail(String.format("Error > 0.001: cdf(%d) - cdf(%d) = %f, pdf(%d) = %f",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.