summaryrefslogtreecommitdiff
path: root/numpy/random/tests
diff options
context:
space:
mode:
authorKevin Sheppard <kevin.k.sheppard@gmail.com>2017-08-22 12:11:30 +0100
committerKevin Sheppard <kevin.k.sheppard@gmail.com>2017-08-22 15:30:32 +0100
commit94dadea7e3fa338bad7fffce4751731501337781 (patch)
tree49bc8a69a14c591c75fba7dc600298da8bc1b735 /numpy/random/tests
parent3c887aa5242857ef92870d2988de7c899c6415be (diff)
downloadnumpy-94dadea7e3fa338bad7fffce4751731501337781.tar.gz
ENH: Remove unnecessary restriction in noncen-f
Set dfnum restriction to be > 0 as required by noncentral chisquare closes #6638
Diffstat (limited to 'numpy/random/tests')
-rw-r--r--numpy/random/tests/test_random.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py
index 39c45889f..a530b9e13 100644
--- a/numpy/random/tests/test_random.py
+++ b/numpy/random/tests/test_random.py
@@ -1106,7 +1106,13 @@ class TestBroadcast(object):
assert_raises(ValueError, nonc_f, bad_dfnum, dfden, nonc * 3)
assert_raises(ValueError, nonc_f, dfnum, bad_dfden, nonc * 3)
assert_raises(ValueError, nonc_f, dfnum, dfden, bad_nonc * 3)
-
+
+ def test_noncentral_f_small_df(self):
+ self.setSeed()
+ desired = np.array([6.869638627492048, 0.785880199263955])
+ actual = np.random.noncentral_f(0.9, 0.9, 2, size=2)
+ assert_array_almost_equal(actual, desired, decimal=14)
+
def test_chisquare(self):
df = [1]
bad_df = [-1]