## Examples of nextGaussian()

• com.heatonresearch.aifh.randomize.GenerateRandom.nextGaussian()
@return The next normally distributed random number.
• com.heatonresearch.aifh.randomize.MersenneTwisterGenerateRandom.nextGaussian()
• com.orientechnologies.common.util.MersenneTwisterFast.nextGaussian()
• java.util.Random.nextGaussian()
een -1.0 and 1.0 v2=2 * nextDouble() - 1; // between -1.0 and 1.0 s=v1 * v1 + v2 * v2; } while (s >= 1 || s == 0); double multiplier = StrictMath.sqrt(-2 * StrictMath.log(s)/s); nextNextGaussian = v2 * multiplier; haveNextNextGaussian = true; return v1 * multiplier; } }} This uses the polar method of G. E. P. Box, M. E. Muller, and G. Marsaglia, as described by Donald E. Knuth in The Art of Computer Programming, Volume 3: Seminumerical Algorithms, section 3.4.1, subsection C, algorithm P. Note that it generates two independent values at the cost of only one call to {@code StrictMath.log}and one call to {@code StrictMath.sqrt}. @return the next pseudorandom, Gaussian ("normally") distributed{@code double} value with mean {@code 0.0} andstandard deviation {@code 1.0} from this random numbergenerator's sequence
• org.apache.commons.math.random.JDKRandomGenerator.nextGaussian()
• org.apache.commons.math.random.RandomData.nextGaussian()
tl.nist.gov/div898/handbook/eda/section3/eda3661.htm"> Normal Distribution

Preconditions:

• `sigma > 0` (otherwise an IllegalArgumentException is thrown.)

@param mu Mean of the distribution @param sigma Standard deviation of the distribution @return random value from Gaussian distribution with mean = mu,standard deviation = sigma
• org.apache.commons.math.random.RandomDataImpl.nextGaussian()
Generate a random value from a Normal (a.k.a. Gaussian) distribution with the given mean, `mu` and the given standard deviation, `sigma`. @param mu the mean of the distribution @param sigma the standard deviation of the distribution @return the random Normal value @throws NotStrictlyPositiveException if {@code sigma <= 0}.
• org.apache.commons.math.random.RandomGenerator.nextGaussian()
Returns the next pseudorandom, Gaussian ("normally") distributed `double` value with mean `0.0` and standard deviation `1.0` from this random number generator's sequence. @return the next pseudorandom, Gaussian ("normally") distributed`double` value with mean `0.0` and standard deviation `1.0` from this random number generator's sequence
• org.apache.commons.math3.random.JDKRandomGenerator.nextGaussian()
Returns the next pseudorandom, Gaussian ("normally") distributed `double` value with mean `0.0` and standard deviation `1.0` from this random number generator's sequence. @return the next pseudorandom, Gaussian ("normally") distributed`double` value with mean `0.0` and standard deviation `1.0` from this random number generator's sequence
• org.apache.commons.math3.random.RandomData.nextGaussian()
tl.nist.gov/div898/handbook/eda/section3/eda3661.htm"> Normal Distribution

@param mu the mean of the distribution @param sigma the standard deviation of the distribution @return a random value following the specified Gaussian distribution @throws NotStrictlyPositiveException if {@code sigma <= 0}.
• org.apache.commons.math3.random.RandomDataImpl.nextGaussian()
{@inheritDoc}
• org.apache.commons.math3.random.RandomGenerator.nextGaussian()
Returns the next pseudorandom, Gaussian ("normally") distributed `double` value with mean `0.0` and standard deviation `1.0` from this random number generator's sequence. @return the next pseudorandom, Gaussian ("normally") distributed`double` value with mean `0.0` and standard deviation `1.0` from this random number generator's sequence
• org.apache.mahout.common.RandomWrapper.nextGaussian()

### Examples of com.heatonresearch.aifh.randomize.GenerateRandom.nextGaussian()

 `9293949596979899100101102` ```        final double[][] actual = new double[rows][cols];         for (int row = 0; row < rows; row++) {             for (int col = 0; col < cols; col++) {                 ideal[row][col] = rnd.nextDouble(low, high);                 actual[row][col] = ideal[row][col] + (rnd.nextGaussian() * distort);             }         }         final DataHolder result = new DataHolder();         result.setActual(actual); ```
View Full Code Here

### Examples of com.heatonresearch.aifh.randomize.MersenneTwisterGenerateRandom.nextGaussian()

 `9293949596979899100101102` ```        final double[][] actual = new double[rows][cols];         for (int row = 0; row < rows; row++) {             for (int col = 0; col < cols; col++) {                 ideal[row][col] = rnd.nextDouble(low, high);                 actual[row][col] = ideal[row][col] + (rnd.nextGaussian() * distort);             }         }         final DataHolder result = new DataHolder();         result.setActual(actual); ```
View Full Code Here

### Examples of com.orientechnologies.common.util.MersenneTwisterFast.nextGaussian()

 `103104105106107108109110111112113` ```    Set keys = new HashSet();     MersenneTwisterFast random = new MersenneTwisterFast();     keys.clear();     while (keys.size() < KEYS_COUNT) {       int key = (int) (random.nextGaussian() * Integer.MAX_VALUE / 2 + Integer.MAX_VALUE);       localHashTable.put(key, key + "");       keys.add(key);       Assert.assertEquals(localHashTable.get(key), "" + key);     } ```
View Full Code Here

### Examples of java.util.Random.nextGaussian()

 `7879808182838485868788` ```        FastMultiByteArrayOutputStream out = new FastMultiByteArrayOutputStream(4096);         DataOutputStream data = new DataOutputStream(out);         Random rand = new Random(3333);         for(int times = 0; times < 3; times++) {             for(int i = 0; i < 10000; i++) {                 data.writeDouble(rand.nextGaussian());             }             probe(out.toByteArray_clear());         }     } ```
View Full Code Here

### Examples of java.util.Random.nextGaussian()

 `7879808182838485868788` ```        FastMultiByteArrayOutputStream out = new FastMultiByteArrayOutputStream(4096);         DataOutputStream data = new DataOutputStream(out);         Random rand = new Random(3333);         for(int times = 0; times < 3; times++) {             for(int i = 0; i < 10000; i++) {                 data.writeDouble(rand.nextGaussian());             }             probe(out.toByteArray_clear());         }     } ```
View Full Code Here

### Examples of java.util.Random.nextGaussian()

 `242243244245246247248249250251252` ```      for (int j = 0; j < 10; j++) {         input.put(String.valueOf(i) + String.valueOf(j), String.valueOf(i));       }       JSONEvent e = new JSONEvent();       e.setHeaders(input);       e.setBody(String.valueOf(rand.nextGaussian()).getBytes(encoding));       events.add(e);     }     Gson gson = new Gson();     String json = gson.toJson(events, listType);     StringEntity input = new StringEntity(json); ```
View Full Code Here

### Examples of java.util.Random.nextGaussian()

 `297298299300301302303304305306307` ```      for (int j = 0; j < 10; j++) {         input.put(String.valueOf(i) + String.valueOf(j), String.valueOf(i));       }       JSONEvent e = new JSONEvent();       e.setHeaders(input);       e.setBody(String.valueOf(rand.nextGaussian()).getBytes(encoding));       events.add(e);     }     Gson gson = new Gson();     String json = gson.toJson(events, listType);     StringEntity input = new StringEntity(json); ```
View Full Code Here

### Examples of java.util.Random.nextGaussian()

 `332333334335336337338339340341342` ```        input.put(String.valueOf(i) + String.valueOf(j), String.valueOf(i));       }       input.put("MsgNum", String.valueOf(i));       JSONEvent e = new JSONEvent();       e.setHeaders(input);       e.setBody(String.valueOf(rand.nextGaussian()).getBytes("UTF-8"));       events.add(e);     }     Gson gson = new Gson();     String json = gson.toJson(events, listType);     HttpsURLConnection httpsURLConnection = null; ```
View Full Code Here

### Examples of java.util.Random.nextGaussian()

 `421422423424425426427428429430431` ```            input.put(String.valueOf(i) + String.valueOf(j), String.valueOf(i));         }         input.put("MsgNum", String.valueOf(i));         JSONEvent e = new JSONEvent();         e.setHeaders(input);         e.setBody(String.valueOf(rand.nextGaussian()).getBytes("UTF-8"));         events.add(e);     }     Gson gson = new Gson();     String json = gson.toJson(events, listType);     HttpURLConnection httpURLConnection = null; ```
View Full Code Here

### Examples of java.util.Random.nextGaussian()

 `5354555657585960616263` ```    ArrayList train = new ArrayList();     // 1. generate positive train samples     for (int i = 0; i < nbPosTrain; i++) {       double[] t = new double[dimension];       for (int x = 0; x < dimension; x++) {         t[x] = ran.nextGaussian();       }       train.add(t);     }     System.out.println("Samples generated"); ```
View Full Code Here