[Numpy-svn] r5634 - branches/1.1.x/numpy/random/mtrand

numpy-svn@scip... numpy-svn@scip...
Tue Aug 12 17:02:39 CDT 2008


Author: rkern
Date: 2008-08-12 17:02:39 -0500 (Tue, 12 Aug 2008)
New Revision: 5634

Modified:
   branches/1.1.x/numpy/random/mtrand/distributions.c
Log:
BUG: F distributions need the appropriate scale factor.

Modified: branches/1.1.x/numpy/random/mtrand/distributions.c
===================================================================
--- branches/1.1.x/numpy/random/mtrand/distributions.c	2008-08-12 22:01:42 UTC (rev 5633)
+++ branches/1.1.x/numpy/random/mtrand/distributions.c	2008-08-12 22:02:39 UTC (rev 5634)
@@ -225,7 +225,8 @@
 
 double rk_f(rk_state *state, double dfnum, double dfden)
 {
-    return rk_chisquare(state, dfnum) / rk_chisquare(state, dfden);
+    return ((rk_chisquare(state, dfnum) * dfden) / 
+            (rk_chisquare(state, dfden) * dfnum));
 }
 
 double rk_noncentral_f(rk_state *state, double dfnum, double dfden, double nonc)



More information about the Numpy-svn mailing list