nlcpy.random.Generator.poisson
- Generator.poisson(self, lam=1.0, size=None)
- Draws samples from a Poisson distribution. - The Poisson distribution is the limit of the binomial distribution for large N. - Parameters
- lamfloat
- Expectation of interval, must be >= 0. A sequence of expectation intervals must be broadcastable over the requested size. 
- sizeint or tuple of ints, optional
- Output shape. If the given shape is, e.g., - (m, n, k), then- m * n * ksamples are drawn.
 
- Returns
- outndarray
- Drawn samples from the parameterized Poisson distribution. 
 
 - Note - The Poisson distribution - For events with an expected separation - the Poisson distribution - describes the probability of - events occurring within the observed interval - . - Because the output is limited to the range of the C int64 type, a ValueError is raised when lam is within 10 sigma of the maximum representable value. - Restriction - If lam is neither a scalar nor None : NotImplementedError occurs. 
 - Examples - Draw samples from the distribution: - >>> import nlcpy as vp >>> rng = vp.random.default_rng() >>> s = rng.poisson(5, 10000) - Display histogram of the sample: - >>> import matplotlib.pyplot as plt >>> count, bins, ignored = plt.hist(s.get(), 14, density=True) >>> plt.show() 