noncentral_chisquare(self, df, nonc, size=None, chunks='auto', **kwargs)
This docstring was copied from numpy.random.mtrand.RandomState.noncentral_chisquare.
Some inconsistencies with the Dask version may exist.
The noncentral $\chi^2$ distribution is a generalization of the $\chi^2$ distribution.
New code should use the noncentral_chisquare
method of a default_rng()
instance instead; please see the :None:ref:`random-quick-start`
.
The probability density function for the noncentral Chi-square distribution is
$$P(x;df,nonc) = \sum^{\infty}_{i=0}\frac{e^{-nonc/2}(nonc/2)^{i}}{i!} P_{Y_{df+2i}}(x),$$where $Y_{q}$ is the Chi-square with q degrees of freedom.
Degrees of freedom, must be > 0.
Earlier NumPy versions required dfnum > 1.
Non-centrality, must be non-negative.
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 df
and nonc
are both scalars. Otherwise, np.broadcast(df, nonc).size
samples are drawn.
Drawn samples from the parameterized noncentral chi-square distribution.
Draw samples from a noncentral chi-square distribution.
Generator.noncentral_chisquare
which should be used for new code.
Draw values from the distribution and plot the histogram
This example is valid syntax, but we were not able to check execution>>> import matplotlib.pyplot as plt # doctest: +SKIP
... values = plt.hist(np.random.noncentral_chisquare(3, 20, 100000), # doctest: +SKIP
... bins=200, density=True)
... plt.show() # doctest: +SKIP
Draw values from a noncentral chisquare with very small noncentrality, and compare to a chisquare.
This example is valid syntax, but we were not able to check execution>>> plt.figure() # doctest: +SKIP
... values = plt.hist(np.random.noncentral_chisquare(3, .0000001, 100000), # doctest: +SKIP
... bins=np.arange(0., 25, .1), density=True)
... values2 = plt.hist(np.random.chisquare(3, 100000), # doctest: +SKIP
... bins=np.arange(0., 25, .1), density=True)
... plt.plot(values[1][0:-1], values[0]-values2[0], 'ob') # doctest: +SKIP
... plt.show() # doctest: +SKIP
Demonstrate how large values of non-centrality lead to a more symmetric distribution.
This example is valid syntax, but we were not able to check execution>>> plt.figure() # doctest: +SKIPSee :
... values = plt.hist(np.random.noncentral_chisquare(3, 20, 100000), # doctest: +SKIP
... bins=200, density=True)
... plt.show() # doctest: +SKIP
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