[SciPy-user] small bug in random.noncentral_f

alan@ajackso... alan@ajackso...
Sun Jun 28 22:03:56 CDT 2009


(pardon me if this shows up twice. I seem to be having list issues)

Currently working on documenting various functions, and I think I found
a buglet with the random.noncentral_f function.

Parameters are dfnum, dfden, and nonc, for the two degrees of freedom
and the non=centrality.  If noncentrality is zero, then this should
reduce to simply an F statistic. But when I tested the function, it
does not allow a dfnum = 1, while random.f does.

In [15]: np.random.f(1., 48, 10)
Out[15]: 
array([ 0.00858266,  0.03674191,  0.01160252,  0.00440044,  0.00113941,
        0.00145305,  0.07257887,  0.01387694,  0.08171868,  0.00591559])
In [16]: np.random.noncentral_f(1., 48, 0, 10)
ValueError: dfnum <= 1

Interestingly I tried the equivalent function in R, and it even works
for dfnum<1, though I'm not clear on what that means.

> rf(10, .9, 48, 0)  
 [1] 0.005920147 0.246702423 0.213558149 0.328364697 4.157683259
0.048531606 [7] 0.463760833 6.817103616 0.058326258 0.813737713



-- 
-----------------------------------------------------------------------
| Alan K. Jackson            | To see a World in a Grain of Sand      |
| alan@ajackson.org          | And a Heaven in a Wild Flower,         |
| www.ajackson.org           | Hold Infinity in the palm of your hand |
| Houston, Texas             | And Eternity in an hour. - Blake       |
-----------------------------------------------------------------------


More information about the SciPy-user mailing list