MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / sample

Method sample

JSAT/src/jsat/distributions/Distribution.java:188–195  ·  view source on GitHub ↗

This method returns a double array containing the values of random samples from this distribution. @param numSamples the number of random samples to take @param rand the source of randomness @return an array of the random sample values

(int numSamples, Random rand)

Source from the content-addressed store, hash-verified

186 * @return an array of the random sample values
187 */
188 public double[] sample(int numSamples, Random rand)
189 {
190 double[] samples = new double[numSamples];
191 for(int i = 0; i < samples.length; i++)
192 samples[i] = invCdf(rand.nextDouble());
193
194 return samples;
195 }
196
197 /**
198 * This method returns a double array containing the values of random samples from this distribution.

Callers 1

sampleVecMethod · 0.95

Calls 2

invCdfMethod · 0.95
nextDoubleMethod · 0.45

Tested by

no test coverage detected