sample

abstract fun sample(random: Random): Double(source)

Draws a single random value from this distribution.

Return

a random value drawn from this distribution.

Parameters

random

the source of randomness.


open fun sample(n: Int, random: Random): DoubleArray(source)

Draws n independent random values from this distribution.

Each element in the returned array is drawn independently using sample. Subclasses may override this method to provide batch-optimized sampling.

Return

a DoubleArray of n independent random draws.

Parameters

n

the number of values to draw. Must be non-negative.

random

the source of randomness.

Throws