Package org.apache.commons.math3.distribution

Examples of org.apache.commons.math3.distribution.WeibullDistribution.sample()


            int size = r.nextInt(20) + 4;

            double[][] data = new double[size][size];
            for (int i = 0; i < size; i++) {
                for (int j = 0; j < size; j++) {
                    data[i][j] = dist.sample();
                }
            }

            RealMatrix m = MatrixUtils.createRealMatrix(data);
            checkUnsymmetricMatrix(m);
View Full Code Here


        }
       
        List<Vector2D> points = new ArrayList<Vector2D>();
        for (int i = 0; i < centers; i++) {
            for (int j = 0; j < nSamplesPerCenter[i]; j++) {
                Vector2D point = new Vector2D(dist.sample(), dist.sample());
                points.add(point.add(centerPoints[i]));
            }
        }
       
        if (shuffle) {
View Full Code Here

        }
       
        List<Vector2D> points = new ArrayList<Vector2D>();
        for (int i = 0; i < centers; i++) {
            for (int j = 0; j < nSamplesPerCenter[i]; j++) {
                Vector2D point = new Vector2D(dist.sample(), dist.sample());
                points.add(point.add(centerPoints[i]));
            }
        }
       
        if (shuffle) {
View Full Code Here

  public static double rNorm(double mean, double sd) {
    RealDistribution dist = new NormalDistribution(RANDOM.getRandomGenerator(),
                                                   mean,
                                                   sd,
                                                   NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
    return dist.sample();
  }
 
  /**
   * Return the normal density function value for the sample x
   *
 
View Full Code Here

            int size = r.nextInt(20) + 4;

            double[][] data = new double[size][size];
            for (int i = 0; i < size; i++) {
                for (int j = 0; j < size; j++) {
                    data[i][j] = dist.sample();
                }
            }

            RealMatrix m = MatrixUtils.createRealMatrix(data);
            RealMatrix h = checkAEqualPHPt(m);
View Full Code Here

            int size = r.nextInt(20) + 4;

            double[][] data = new double[size][size];
            for (int i = 0; i < size; i++) {
                for (int j = 0; j < size; j++) {
                    data[i][j] = dist.sample();
                }
            }

            RealMatrix m = MatrixUtils.createRealMatrix(data);
            RealMatrix s = checkAEqualPTPt(m);
View Full Code Here

            int size = r.nextInt(20) + 4;

            double[][] data = new double[size][size];
            for (int i = 0; i < size; i++) {
                for (int j = 0; j < size; j++) {
                    data[i][j] = dist.sample();
                }
            }

            RealMatrix m = MatrixUtils.createRealMatrix(data);
            checkUnsymmetricMatrix(m);
View Full Code Here

        // and fill valuesList with values from values array with
        // values[i] repeated weights[i] times, each i
        final RealDistribution valueDist = new NormalDistribution(mu, sigma);
        List<Double> valuesList = new ArrayList<Double>();
        for (int i = 0; i < len; i++) {
            double value = valueDist.sample();
            values[i] = value;
            for (int j = 0; j < intWeights[i]; j++) {
                valuesList.add(new Double(value));
            }
        }
View Full Code Here

  public static double rNorm(double mean, double sd) {
    RealDistribution dist = new NormalDistribution(RANDOM.getRandomGenerator(),
                                                   mean,
                                                   sd,
                                                   NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
    return dist.sample();
  }
 
  /**
   * Returns an integer sampled according to this distribution. Takes time proportional to np + 1. (Reference:
   * Non-Uniform Random Variate Generation, Devroye http://cgm.cs.mcgill.ca/~luc/rnbookindex.html) Second
View Full Code Here

            this.connectionWeights = new DenseMatrix( nVisible, nHidden );
            this.connectionWeights.assign(0);

            for(int i = 0; i < this.connectionWeights.numRows(); i++) {
                for(int j = 0; j < this.connectionWeights.numCols(); j++) {
                    this.connectionWeights.set(i,j,u.sample());
                }
            }


        } else {
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.