Examples of cdf()


Examples of cern.jet.random.ChiSquare.cdf()

            chiSq += chiSq(ids.count(id), expected);
        }
        System.out.println("X^2 = " + chiSq);
        ChiSquare dist = new ChiSquare(df, new MersenneTwister());
        // p-value is ~= prob of seeing this distribution from fair router
        double pValue = 1.0 - dist.cdf(chiSq);
        System.out.println("p-value = " + pValue);
        assertTrue("Non-uniform load distribution detected.", pValue >= 0.05);
    }

    private double chiSq(double observed, double expected) {
View Full Code Here

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

   */
  @Test
  public void testGeom() {
    GeometricDistribution d = new GeometricDistribution();
    d.init(1, Long.MAX_VALUE, 0.3, 1.0);
    assertEquals(0.3, d.cdf(1), 0.001);
    assertEquals(0.51, d.cdf(2), 0.001);
    assertEquals(0.657, d.cdf(3), 0.001);
    assertEquals(0.917646, d.cdf(7), 0.001);
    assertEquals(0.971752, d.cdf(10), 0.001);
    assertEquals(0.995252, d.cdf(15), 0.001);
View Full Code Here

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

  @Test
  public void testGeom() {
    GeometricDistribution d = new GeometricDistribution();
    d.init(1, Long.MAX_VALUE, 0.3, 1.0);
    assertEquals(0.3, d.cdf(1), 0.001);
    assertEquals(0.51, d.cdf(2), 0.001);
    assertEquals(0.657, d.cdf(3), 0.001);
    assertEquals(0.917646, d.cdf(7), 0.001);
    assertEquals(0.971752, d.cdf(10), 0.001);
    assertEquals(0.995252, d.cdf(15), 0.001);
View Full Code Here

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

  public void testGeom() {
    GeometricDistribution d = new GeometricDistribution();
    d.init(1, Long.MAX_VALUE, 0.3, 1.0);
    assertEquals(0.3, d.cdf(1), 0.001);
    assertEquals(0.51, d.cdf(2), 0.001);
    assertEquals(0.657, d.cdf(3), 0.001);
    assertEquals(0.917646, d.cdf(7), 0.001);
    assertEquals(0.971752, d.cdf(10), 0.001);
    assertEquals(0.995252, d.cdf(15), 0.001);

    assertEquals(0.3, d.pdf(1), 0.001);
View Full Code Here

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

    GeometricDistribution d = new GeometricDistribution();
    d.init(1, Long.MAX_VALUE, 0.3, 1.0);
    assertEquals(0.3, d.cdf(1), 0.001);
    assertEquals(0.51, d.cdf(2), 0.001);
    assertEquals(0.657, d.cdf(3), 0.001);
    assertEquals(0.917646, d.cdf(7), 0.001);
    assertEquals(0.971752, d.cdf(10), 0.001);
    assertEquals(0.995252, d.cdf(15), 0.001);

    assertEquals(0.3, d.pdf(1), 0.001);
    assertEquals(0.21, d.pdf(2), 0.001);
View Full Code Here

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

    d.init(1, Long.MAX_VALUE, 0.3, 1.0);
    assertEquals(0.3, d.cdf(1), 0.001);
    assertEquals(0.51, d.cdf(2), 0.001);
    assertEquals(0.657, d.cdf(3), 0.001);
    assertEquals(0.917646, d.cdf(7), 0.001);
    assertEquals(0.971752, d.cdf(10), 0.001);
    assertEquals(0.995252, d.cdf(15), 0.001);

    assertEquals(0.3, d.pdf(1), 0.001);
    assertEquals(0.21, d.pdf(2), 0.001);
    assertEquals(0.147, d.pdf(3), 0.001);
View Full Code Here

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

    assertEquals(0.3, d.cdf(1), 0.001);
    assertEquals(0.51, d.cdf(2), 0.001);
    assertEquals(0.657, d.cdf(3), 0.001);
    assertEquals(0.917646, d.cdf(7), 0.001);
    assertEquals(0.971752, d.cdf(10), 0.001);
    assertEquals(0.995252, d.cdf(15), 0.001);

    assertEquals(0.3, d.pdf(1), 0.001);
    assertEquals(0.21, d.pdf(2), 0.001);
    assertEquals(0.147, d.pdf(3), 0.001);
    assertEquals(0.035, d.pdf(7), 0.001);
View Full Code Here

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

  public void testLogNormal() {
    LogNormalDistribution d = new LogNormalDistribution();
    int median = 10;
    d.init(0, 100, median, 1);
    // CDF of median should be 0.5 by def.
    assertEquals(0.5, d.cdf(median), 0.01);


    // Precomputed points
    d.init(0, 1000, 100, 1);
    assertEquals(0.033434, d.cdf(16), 0.0001);
View Full Code Here

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

    assertEquals(0.5, d.cdf(median), 0.01);


    // 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);
  }
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
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.