sample

open override fun sample(random: Random): Double(source)

Draws a single random value from this Gamma distribution.

Uses the Marsaglia-Tsang method for shape >= 1. For shape < 1, draws from Gamma(shape + 1) and applies a power transformation to correct the distribution.

Return

a random non-negative value drawn from this distribution.

Parameters

random

the source of randomness.