Package java.util

Examples of java.util.Random.nextGaussian()


    Random gen = RandomUtils.getRandom();
    for (int col = 0; col < test.columnSize(); col++) {
      int j = gen.nextInt(test.columnSize());
      double old = test.get(col, j);
      double v = gen.nextGaussian();
      test.viewColumn(col).set(j, v);
      assertEquals(v, test.get(j, col), 0);
      assertEquals(v, test.viewColumn(col).get(j), 0);
      test.set(j, col, old);
      assertEquals(old, test.get(j, col), 0);
View Full Code Here


      double[] x0 = new double[2];
      double[] x1 = new double[2];

      for (int i = 0; i < x0.length; i++)
      {
        x0[i] = r.nextGaussian();
      }
      for (int i = 0; i < x1.length; i++)
      {
        x1[i] = r.nextGaussian();
      }
View Full Code Here

      {
        x0[i] = r.nextGaussian();
      }
      for (int i = 0; i < x1.length; i++)
      {
        x1[i] = r.nextGaussian();
      }
      p[k] = getPValOfMeanDifference(x0, x1);
    }

    int cnt = 0;
View Full Code Here

    Histogram2D h = new Histogram2D(0.1);
    Histogram2D s = new Histogram2D(0.1);

    for (int i = 0; i < 100000; i++)
    {
      double x = r.nextGaussian();
      double y = r.nextGaussian();
      h.count(x, y);
      if (x + y + r.nextGaussian() > 0) s.count(x, y);

    }
View Full Code Here

    Histogram2D s = new Histogram2D(0.1);

    for (int i = 0; i < 100000; i++)
    {
      double x = r.nextGaussian();
      double y = r.nextGaussian();
      h.count(x, y);
      if (x + y + r.nextGaussian() > 0) s.count(x, y);

    }
View Full Code Here

    for (int i = 0; i < 100000; i++)
    {
      double x = r.nextGaussian();
      double y = r.nextGaussian();
      h.count(x, y);
      if (x + y + r.nextGaussian() > 0) s.count(x, y);

    }

    Histogram2DPlot p = new Histogram2DPlot(h, s);
    p.setVisible(true);
View Full Code Here

        Random random = new Random();

        for (int i = 0; i <= 1000; i++) {
            this.addPoint(0, 5.0 * Math.cos((Math.PI * i) / 500.0));
            this.addPoint(1, (10.0 * random.nextDouble()) - 5.0);
            this.addPoint(2, 2.0 * random.nextGaussian());
        }

        this.repaint();
    }

View Full Code Here

    Random gen = RandomUtils.getRandom();
    for (int row = 0; row < c[ROW]; row++) {
      int j = gen.nextInt(c[COL]);
      double old = test.get(row, j);
      double v = gen.nextGaussian();
      test.viewRow(row).set(j, v);
      assertEquals(v, test.get(row, j), 0);
      assertEquals(v, test.viewRow(row).get(j), 0);
      test.set(row, j, old);
      assertEquals(old, test.get(row, j), 0);
View Full Code Here

    Random gen = RandomUtils.getRandom();
    for (int col = 0; col < c[COL]; col++) {
      int j = gen.nextInt(c[COL]);
      double old = test.get(col, j);
      double v = gen.nextGaussian();
      test.viewColumn(col).set(j, v);
      assertEquals(v, test.get(j, col), 0);
      assertEquals(v, test.viewColumn(col).get(j), 0);
      test.set(j, col, old);
      assertEquals(old, test.get(j, col), 0);
View Full Code Here

      BitSet featureSpace = new BitSet(cardinality);
      int[] indexes = new int[sparsity];
      double[] values = new double[sparsity];
      int j = 0;
      while (j < sparsity) {
        double value = r.nextGaussian();
        int index = r.nextInt(cardinality);
        if (!featureSpace.get(index)) {
          featureSpace.set(index);
          indexes[j] = index;
          values[j++] = value;
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.