Simple scipy question F-distribution

K

Kurt

Okay,

This should be a really beginner question. I'd like to calculate the
cutoff value for the F-distribution given for example F(x)=0.95 and
m=2, n=9 which should be about 4.26. Is there an easy way to this in
python with say scipy?

Thanks!
-kurt
http://schwehr.org/
 
R

Robert Kern

Kurt said:
Okay,

This should be a really beginner question. I'd like to calculate the
cutoff value for the F-distribution given for example F(x)=0.95 and
m=2, n=9 which should be about 4.26. Is there an easy way to this in
python with say scipy?

Yes. The following should work, but I think there's currently a bug in the F
distribution if the numbers you give are actually correct (I have not checked
independently).

from scipy.stats import distributions
x = distributions.f.ppf(0.95, 2, 9)

This currently gives the wrong result if your numbers are right.
distributions.f.ppf(0.05, 2, 9) does give something close to 4.26 .
The PPF is supposed to be the inverse of the CDF and f.cdf(4.26, 2, 9) does give
0.95 or thereabouts, I think this is actually a bug. I shall report it.

Also, SciPy questions are usually better addressed on the SciPy mailing list.
http://www.scipy.org/site_content/MailList

--
Robert Kern
(e-mail address removed)

"In the fields of Hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top