| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Changed alpha value error to pass a null value. This way, dirichlet function (on the generator, not mtrand) won't raise a value exception at 0. Also added test.
|
|
|
|
|
| |
The original PR forgot to include the Parameters section (and thus
the paraeter itself).
|
|
|
|
| |
[skip cirrus]
|
| |
|
|
|
|
| |
Trying to address Robert Kerns review comments.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes the seed sequence interface more public facing by:
1. Adding `BitGenerator.seed_seq` to give clear access to `_seed_seq`
2. Add `spawn()` to both the generator and the bit generator as
convenience methods for spawning new instances.
I somewhat remember that we always meant to consider making this
more public and adding such convenient methods, but did not do
so originally.
So, now, I do wonder whether it is time to make this fully public?
It would be nice to follow up at some point with a bit of best practices.
This also doesn't add it to the `RandomState`, although doing it via
`RandomState._bit_generator` is of course valid.
Can we define as this kind of access as stable enough that downstream
libraries could use it? I fear that backcompat with `RandomState`
might make adopting newer things like spawning hard for libraries?
|
|
|
|
|
| |
Make a note on results depending on system due.
Closes gh-22919
|
|
|
|
|
|
|
|
|
|
|
| |
* DOC: add examples for random generator exponential function (Issue #22270)
* DOC: fix doc test for random exponential generator example (Issue #22270)
* DOC: fix formatting on np.random.exponential example (Issue: #22270)
* DOC: fix test and problem context on np.random.exponential example (Issue: #22270)
* DOC: use may vary instead of will vary for exponential example (Issue: #22270)
|
| |
|
|
|
|
|
|
|
|
| |
Logseries previously did not enforce bounds to be strictly exclusive
for the upper bound, where it leads to incorrect behavior.
The NOT_NAN check is removed, since it was never used: The current bounded
version always excludes NaNs.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
numpy.random.multivariate_normal more descriptive (closes #22140)
Issue #22140 says that numpy.random.multivariate_normal incorrectly warns that a non-symmetric positive-semidefinite matrix isn't positive-semidefinite. In the replies, there was some ambiguity over whether it was possible for a positive-semidefinite matrix to be non-symmetric, with reliable sources saying that symmetry is a common condition to add but not actually necessary. To solve this problem, two different members of the Numpy organization decided that the warning and error message "covariance is not positive-semidefinite" should be changed to "covariance is not symmetric positive-semidefinite". However, this change was never actually made yet.
Since this change only required me to change a few strings instead of actually changing the code, I've decided to skip the CI jobs.
[skip ci]
|
|
|
|
|
|
|
| |
Allow bit generators to supply their own constructors to enable Generator
objects using arbitrary bit generators to be supported
closes #22012
|
|\
| |
| | |
DOC: Mention uniform in the np.random.Generator.random function.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| | |
Added a See also section to mention np.random.Generator.uniform.
|
|/
|
|
| |
Closes gh-21910
|
|
|
|
|
|
|
|
|
| |
The meaning of the second argument in the mathematical notation
N(mu, b) for the normal distribution is not consistent. In some
references it is the variance while in others it is the standard
deviation. Let's avoid the ambiguity by not using the notation.
Fixes #21296
|
|
|
|
|
|
|
| |
* Disallow both mean and cov from being complex.
* Raise a TypeError instead of a NotImplementedError if mean or cov is
complex.
* Expand and fix the unit test.
|
|
|
|
|
| |
This commit disallows complex covariances in multivariate_normal
as passing them can silently lead to incorrect results.
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
Made suggested changes to also add Reference on handling of axis parameter
|
| |
|
|
|
|
| |
Kept the Python code output uniform
|
| |
|
| |
|
| |
|
|
|
|
| |
negative_binomial
|
|
|
|
| |
for large values
|
|\
| |
| | |
DOC: random: Fix a comment and example in the multivariate_normal docstring
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
The covariance matrix is the identity, so the standard deviation of
each component is 1.0.
|
|/ |
|
|
|
|
|
|
| |
One of the code examples in the docstring of
`numpy.random.Generator.multivariate_normal()` was not being displayed
properly in the built documentation.
|
|
|
|
| |
xref github issue #15201
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
There was a mistake in the code that generated
the plot in the zipf docstring. The Riemann
zeta function is `scipy.special.zeta`, not
`scipy.special.zetac`.
I also tweaked the sample parameters and the plot
code so the plot is a bit more informative.
|
|
|
| |
Current documentation for random.power and random.Generator.power states that ValueError is raised if a < 1; however the power function distribution only supports strictly positive a > 0 and raises ValueError if a <= 0. Fixed documentation to reflect this.
|
|
|
|
|
|
|
| |
Add note to the description of the \"high\" parameter to indicate that it is possible
for the value to be included in the returned values due to floating point precision, despite
the fact that it represents an open interval.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
|
|
|
|
|
|
| |
Replace pattern of casting PyArray_DATA to size_t then char
in favor of direct use of PyArray_BYTES
closes #19941
|