Equivalent method in java (numpy.random.normal(mean,var)) -
is there method in java equivalent numpy.random.normal(mean,variance).
you can use java.util.random class:
random r = new random(); double randomvalue = mean + r.nextgaussian()*variance; note if need multiple random values, can use r multiple times. can supply constructor specific seed random r = new random(1234);.
Comments
Post a Comment