List of utility methods to do Gaussian
double[][] | addGaussianNoise(double[][] d, double m, double v) Matlab compatible see code of imnoise in Matlab double[][] r = new double[d.length][d[0].length]; Random rnd = new Random(); for (int i = 0; i < d.length; i++) { for (int j = 0; j < d[0].length; j++) { r[i][j] = Math.round(m + d[i][j] + rnd.nextGaussian() * Math.sqrt(v)); return r; ... |
double | gaussian() Returns a real number with a standard Gaussian distribution. double r, x, y; do { x = uniform(-1.0, 1.0); y = uniform(-1.0, 1.0); r = x * x + y * y; } while (r >= 1 || r == 0); return x * Math.sqrt(-2 * Math.log(r) / r); |
double | getGaussian() get Gaussian return random.nextGaussian();
|
double | getGaussian(double aMean, double aVariance) get Gaussian return aMean + fRandom.nextGaussian() * aVariance;
|
double | hashToGaussian(int h) hash To Gaussian Random random = new Random(h); for (int i = 0; i < 5; i++) { random.nextGaussian(); random.nextGaussian(); random.nextGaussian(); random.nextGaussian(); random.nextGaussian(); return random.nextGaussian(); |
double | RandGaussian() Rand Gaussian return RandGaussian(0, 1);
|