8000 BUG: Fixed Von Mises distribution for big values of kappa by bashtage · Pull Request #18498 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: Fixed Von Mises distribution for big values of kappa #18498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 26, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added test for [-np.pi, np.pi] range for the von mises distribution u…
…sing large values of kappa (>1e6)
  • Loading branch information
Androp0v authored and bashtage committed Feb 26, 2021
commit 5fa800a32341f24ecc178eb754dc91c9b5d0db2c
3 changes: 3 additions & 0 deletions numpy/random/tests/test_generator_mt19937_regressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ def test_VonMises_range(self):
for mu in np.linspace(-7., 7., 5):
r = mt19937.vonmises(mu, 1, 50)
assert_(np.all(r > -np.pi) and np.all(r <= np.pi))
for mu in [-np.pi, np.pi]:
r = mt19937.vonmises(mu, 10**6 + 1, 50)
assert_(np.all(r > -np.pi) and np.all(r <= np.pi))

def test_hypergeometric_range(self):
# Test for ticket #921
Expand Down
3 changes: 3 additions & 0 deletions numpy/random/tests/test_randomstate_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ def test_VonMises_range(self):
for mu in np.linspace(-7., 7., 5):
r = random.vonmises(mu, 1, 50)
assert_(np.all(r > -np.pi) and np.all(r <= np.pi))
for mu in [-np.pi, np.pi]:
r = random.vonmises(mu, 10**6 + 1, 50)
assert_(np.all(r > -np.pi) and np.all(r <= np.pi))

def test_hypergeometric_range(self):
# Test for ticket #921
Expand Down
3 changes: 3 additions & 0 deletions numpy/random/tests/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ def test_VonMises_range(self):
for mu in np.linspace(-7., 7., 5):
r = random.mtrand.vonmises(mu, 1, 50)
assert_(np.all(r > -np.pi) and np.all(r <= np.pi))
for mu in [-np.pi, np.pi]:
r = random.mtrand.vonmises(mu, 10**6 + 1, 50)
assert_(np.all(r > -np.pi) and np.all(r <= np.pi))

def test_hypergeometric_range(self):
# Test for ticket #921
Expand Down
0