Package hep.aida.bin

Examples of hep.aida.bin.QuantileBin1D


  /*
   * Set up the QuantileBin1D object
   */
  DRand rand = new DRand(new Date());
  QuantileBin1D qAccum = new QuantileBin1D(false,
             N,
             1.e-4,
             1.e-3,
             200,
             rand,
             false,
             false,
             2);

  DynamicBin1D dbin = new DynamicBin1D();
 
  /*
   * Use a new random number generator to generate numExamples
   * random gaussians, and add them to the QuantileBin1D
   */
  Uniform dataRand = new Uniform(new DRand(7757));
  for (int i = 1; i <= numExamples; i++) {
    double gauss = dataRand.nextDouble();
      qAccum.add(gauss);
      dbin.add(gauss);
  }
 
  /*
   * print out the percentiles
   */
  DecimalFormat fmt = new DecimalFormat("0.00");
  System.out.println();
  //int step = 1;
  int step = 10;
  for (int i = 1; i < 100; ) {
      double percent = ((double)i) * 0.01;
      double quantile = qAccum.quantile(percent);
      System.out.println(fmt.format(percent) + "  " + quantile + ",  " + dbin.quantile(percent)+ ",  " + (dbin.quantile(percent)-quantile));
      i = i + step;
  }
}
View Full Code Here


  /*
   * Set up the QuantileBin1D object
   */
  DRand rand = new DRand(new Date());
  QuantileBin1D qAccum = new QuantileBin1D(false,
             N,
             1.e-4,
             1.e-3,
             200,
             rand,
             false,
             false,
             2);

  DynamicBin1D dbin = new DynamicBin1D();
 
  /*
   * Use a new random number generator to generate numExamples
   * random gaussians, and add them to the QuantileBin1D
   */
  Uniform dataRand = new Uniform(new DRand(7757));
  for (int i = 1; i <= numExamples; i++) {
    double gauss = dataRand.nextDouble();
      qAccum.add(gauss);
      dbin.add(gauss);
  }
 
  /*
   * print out the percentiles
   */
  DecimalFormat fmt = new DecimalFormat("0.00");
  System.out.println();
  //int step = 1;
  int step = 10;
  for (int i = 1; i < 100; ) {
      double percent = ((double)i) * 0.01;
      double quantile = qAccum.quantile(percent);
      System.out.println(fmt.format(percent) + "  " + quantile + ",  " + dbin.quantile(percent)+ ",  " + (dbin.quantile(percent)-quantile));
      i = i + step;
  }
}
View Full Code Here

TOP

Related Classes of hep.aida.bin.QuantileBin1D

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.