[Rd] Infinite degrees of freedom for F-distribution
Gordon Smyth
smyth at wehi.edu.au
Fri Apr 22 11:17:17 CEST 2005
This is just a suggestion/wish that it would be nice for the F-distribution
functions to recognize limiting cases for infinite degrees of freedom, as
the t-distribution functions already do.
The t-distribution functions recognize that df=Inf is equivalent to the
standard normal distribution:
> pt(1,df=Inf)
[1] 0.8413447
> pnorm(1)
[1] 0.8413447
On the other hand, pf() will accept Inf for df1, but returns the wrong result:
> pf(1,df1=Inf,df2=1)
[1] 1
whereas the correct limiting value is
> pchisq(1,df=1,lower.tail=FALSE)
[1] 0.3173105
pf() returns NaN when df2=Inf:
> pf(1,df1=1,df2=Inf)
[1] NaN
Warning message:
NaNs produced in: pf(q, df1, df2, lower.tail, log.p)
although the correct value is available as
> pchisq(1,df=1)
[1] 0.6826895
Gordon
> version
_
platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
status
major 2
minor 1.0
year 2005
month 04
day 18
language R
---------------------------------------------------------------------------------------
Dr Gordon K Smyth, Senior Research Scientist, Bioinformatics,
Walter and Eliza Hall Institute of Medical Research,
1G Royal Parade, Parkville, Vic 3050, Australia
Tel: (03) 9345 2326, Fax (03) 9347 0852,
Email: smyth at wehi.edu.au, www: http://www.statsci.org
More information about the R-devel
mailing list