diff options
author | Benjamin Trendelkamp-Schroer <trendelkampschroer@users.noreply.github.com> | 2020-04-29 22:46:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-29 23:46:53 +0300 |
commit | 44e26f24621ce86ed6b24bfba4a04e82319d7bf0 (patch) | |
tree | 7855731fec8f2e2500dd6a8f3619f7e305290cbb /doc | |
parent | 909d6b8fabe2f0fcdeba6927e4506f19aae52f2e (diff) | |
download | numpy-44e26f24621ce86ed6b24bfba4a04e82319d7bf0.tar.gz |
BUG: Fix numpy.random.dirichlet returns NaN for small 'alpha' parameters. (#14924)
* Add stick-breaking
* Add tests demonstrating slowness for beta and dirichlet generators for small alpha (and beta) values
* Remove the test for beta with small `a` and `b`
* Switch from standard to stick-breaking method whenever alpha.max() < 0.1
Co-authored-by: Warren Weckesser <warren.weckesser@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/release/upcoming_changes/14924.compatibility.rst | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/release/upcoming_changes/14924.compatibility.rst b/doc/release/upcoming_changes/14924.compatibility.rst new file mode 100644 index 000000000..8b42437fd --- /dev/null +++ b/doc/release/upcoming_changes/14924.compatibility.rst @@ -0,0 +1,7 @@ +Changed random variate stream from `numpy.random.Generator.dirichlet` +--------------------------------------------------------------------- +A bug in the generation of random variates for the Dirichlet distribution +with small `alpha` values was fixed by using a different algorithm when +``max(alpha) < 0.1``. Because of the change, the stream of variates +generated by `dirichlet` in this case will be different from previous +releases. |