[Scipy-svn] r5566 - in trunk/scipy/stats: . tests

scipy-svn@scip... scipy-svn@scip...
Wed Feb 18 23:24:48 CST 2009


Author: josef
Date: 2009-02-18 23:24:32 -0600 (Wed, 18 Feb 2009)
New Revision: 5566

Modified:
   trunk/scipy/stats/morestats.py
   trunk/scipy/stats/tests/test_morestats.py
Log:
fix fligner for np.var replacement, add simple regression test, no full test available

Modified: trunk/scipy/stats/morestats.py
===================================================================
--- trunk/scipy/stats/morestats.py	2009-02-19 04:52:40 UTC (rev 5565)
+++ trunk/scipy/stats/morestats.py	2009-02-19 05:24:32 UTC (rev 5566)
@@ -862,8 +862,8 @@
 
     # compute Aibar
     Aibar = _apply_func(a,g,sum) / Ni
-    anbar = stats.mean(a, axis=0)
-    varsq = stats.var(a)
+    anbar = np.mean(a, axis=0)
+    varsq = np.var(a,axis=0, ddof=1)
 
     Xsq = sum(Ni*(asarray(Aibar)-anbar)**2.0,axis=0)/varsq
 

Modified: trunk/scipy/stats/tests/test_morestats.py
===================================================================
--- trunk/scipy/stats/tests/test_morestats.py	2009-02-19 04:52:40 UTC (rev 5565)
+++ trunk/scipy/stats/tests/test_morestats.py	2009-02-19 05:24:32 UTC (rev 5566)
@@ -110,5 +110,10 @@
         assert_array_equal(res,[1,2,3,4])
         assert_array_equal(nums,[3,3,2,2])
 
+def test_fligner():
+    x1=np.arange(5)
+    assert_array_equal(stats.fligner(x1,x1**2),
+                       (3.2282229927203558, 0.072379187848207877))
+
 if __name__ == "__main__":
     run_module_suite()



More information about the Scipy-svn mailing list