Package edu.brown.mappings

Examples of edu.brown.mappings.PearsonCorrelationMapping.addOccurrence()


     * testRandomCorrelation
     */
    public void testRandomCorrelation() {
        PearsonCorrelationMapping p = new PearsonCorrelationMapping();
        for (int i = 0; i < num_samples; i++) {
            p.addOccurrence(i, (this.rand.nextDouble() - 0.5) * i);
        }
        assertTrue(Math.abs(p.calculate()) < 0.1);
    }

    /**
 
View Full Code Here


     * testPositiveCorrelation
     */
    public void testPositiveCorrelation() {
        PearsonCorrelationMapping p = new PearsonCorrelationMapping();
        for (int i = 0; i < num_samples; i++) {
            p.addOccurrence(i, (this.rand.nextDouble()) * i);
        }
        assertTrue(Math.abs(p.calculate()) > 0.4);
    }
  
}
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.