weibull(self, a, size=None, chunks='auto', **kwargs)
This docstring was copied from numpy.random.mtrand.RandomState.weibull.
Some inconsistencies with the Dask version may exist.
Draw samples from a 1-parameter Weibull distribution with the given shape parameter a
.
Here, U is drawn from the uniform distribution over (0,1].
The more common 2-parameter Weibull, including a scale parameter $\lambda$ is just $X = \lambda(-ln(U))^{1/a}$ .
New code should use the weibull
method of a default_rng()
instance instead; please see the :None:ref:`random-quick-start`
.
The Weibull (or Type III asymptotic extreme value distribution for smallest values, SEV Type III, or Rosin-Rammler distribution) is one of a class of Generalized Extreme Value (GEV) distributions used in modeling extreme value problems. This class includes the Gumbel and Frechet distributions.
The probability density for the Weibull distribution is
$$p(x) = \frac{a}{\lambda}(\frac{x}{\lambda})^{a-1}e^{-(x/\lambda)^a},$$where $a$ is the shape and $\lambda$ the scale.
The function has its peak (the mode) at $\lambda(\frac{a-1}{a})^{1/a}$ .
When a = 1
, the Weibull distribution reduces to the exponential distribution.
Shape parameter of the distribution. Must be nonnegative.
Output shape. If the given shape is, e.g., (m, n, k)
, then m * n * k
samples are drawn. If size is None
(default), a single value is returned if a
is a scalar. Otherwise, np.array(a).size
samples are drawn.
Drawn samples from the parameterized Weibull distribution.
Draw samples from a Weibull distribution.
Generator.weibull
which should be used for new code.
Draw samples from the distribution:
This example is valid syntax, but we were not able to check execution>>> a = 5. # shape # doctest: +SKIP
... s = np.random.weibull(a, 1000) # doctest: +SKIP
Display the histogram of the samples, along with the probability density function:
This example is valid syntax, but we were not able to check execution>>> import matplotlib.pyplot as plt # doctest: +SKIPThis example is valid syntax, but we were not able to check execution
... x = np.arange(1,100.)/50. # doctest: +SKIP
... def weib(x,n,a): # doctest: +SKIP
... return (a / n) * (x / n)**(a - 1) * np.exp(-(x / n)**a)
>>> count, bins, ignored = plt.hist(np.random.weibull(5.,1000)) # doctest: +SKIPSee :
... x = np.arange(1,100.)/50. # doctest: +SKIP
... scale = count.max()/weib(x, 1., 5.).max() # doctest: +SKIP
... plt.plot(x, weib(x, 1., 5.)*scale) # doctest: +SKIP
... plt.show() # doctest: +SKIP
The following pages refer to to this document either explicitly or contain code examples using this.
dask.array.random.RandomState.gumbel
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them