summaryrefslogtreecommitdiff
path: root/numpy/random/tests/test_random.py
diff options
context:
space:
mode:
authorEvgeni Burovski <evgeni@burovski.me>2015-11-02 13:25:28 +0000
committerEvgeni Burovski <evgeni@burovski.me>2015-11-02 13:25:28 +0000
commit04e40fc5c21335f296009f40f4599b66dc099e6d (patch)
treea67b949004ec571a8fe11dd640d5fa9e7025104b /numpy/random/tests/test_random.py
parent80abf6ebf89c2ccececafc25238716ac13f0019e (diff)
downloadnumpy-04e40fc5c21335f296009f40f4599b66dc099e6d.tar.gz
MAINT: random: allow nonc==0 in noncentral_chisquare.
Noncentral chi-square reduces to a central chi-square, so just defer to that.
Diffstat (limited to 'numpy/random/tests/test_random.py')
-rw-r--r--numpy/random/tests/test_random.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py
index 596c218a2..ab7f90d82 100644
--- a/numpy/random/tests/test_random.py
+++ b/numpy/random/tests/test_random.py
@@ -504,6 +504,13 @@ class TestRandomDist(TestCase):
[ 0.332334982684171 , 0.15451287602753125]])
np.testing.assert_array_almost_equal(actual, desired, decimal=14)
+ np.random.seed(self.seed)
+ actual = np.random.noncentral_chisquare(df=5, nonc=0, size=(3, 2))
+ desired = np.array([[9.597154162763948, 11.725484450296079],
+ [10.413711048138335, 3.694475922923986],
+ [13.484222138963087, 14.377255424602957]])
+ np.testing.assert_array_almost_equal(actual, desired, decimal=14)
+
def test_noncentral_f(self):
np.random.seed(self.seed)
actual = np.random.noncentral_f(dfnum=5, dfden=2, nonc=1,