Package org.apache.mahout.math.jet.random

Examples of org.apache.mahout.math.jet.random.Poisson


  @Test
  public void testRate() {
    Random gen = RandomUtils.getRandom();

    Poisson p = new Poisson(5, gen);
    double lastT = 0;

    double[] k = new double[1000];
    double[] t = new double[1000];
    for (int i = 1; i < 1000; i++) {
      // we sample every 5-15 seconds
      double dt = gen.nextDouble() * 10 + 5;
      t[i] = lastT + dt;

      // at those points, we get a Poisson count
      k[i] = p.nextInt(dt * 0.2);
      lastT = t[i];
    }

    OnlineExponentialAverage averager = new OnlineExponentialAverage(2000);

View Full Code Here

TOP

Related Classes of org.apache.mahout.math.jet.random.Poisson

Copyright © 2018 www.massapicom. 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.