nlcpy.random.Generator.exponential

Generator.exponential(self, scale, size=None)

Draws samples from an exponential distribution.

Its probability density function is

for x > 0 and 0 elsewhere. is the scale parameter, which is the inverse of the rate parameter .

Parameters
scalefloat

The scale parameter, . Must be non-negative.

sizeint or tuple of ints, optional

Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn.

Returns
outndarray

Drawn samples from the parameterized exponential distribution.

• If scale is neither a scalar nor None : NotImplementedError occurs.