Package ca.nengo.math.impl

Examples of ca.nengo.math.impl.PoissonPDF.map()


  }
 
  private static void doTestMap(float rate, float observation, float probability) {
    float tolerance = .00001f;
    PoissonPDF pdf = new PoissonPDF(rate);
    float result = pdf.map(new float[]{observation});
    TestUtil.assertClose(probability, result, tolerance);
  }
 
  public void testSample() {
    doTestSample(1);
View Full Code Here


    for (int i = 0; i < n; i++) {
      int sample = (int) Math.round(pdf.sample()[0]);
      if (sample < bins.length) bins[sample]++;
    }
    for (int i = 0; i < bins.length; i++) {
      TestUtil.assertClose(pdf.map(new float[]{i}), (float) bins[i]/ (float) n, .05f);
    }
   
  }
 
}
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.