FDist                 package:stats                 R Documentation

_T_h_e _F _D_i_s_t_r_i_b_u_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Density, distribution function, quantile function and random
     generation for the F distribution with 'df1' and 'df2' degrees of
     freedom (and optional non-centrality parameter 'ncp').

_U_s_a_g_e:

     df(x, df1, df2, ncp, log = FALSE)
     pf(q, df1, df2, ncp, lower.tail = TRUE, log.p = FALSE)
     qf(p, df1, df2, ncp, lower.tail = TRUE, log.p = FALSE)
     rf(n, df1, df2, ncp)

_A_r_g_u_m_e_n_t_s:

    x, q: vector of quantiles.

       p: vector of probabilities.

       n: number of observations. If 'length(n) > 1', the length is
          taken to be the number required.

df1, df2: degrees of freedom.  'Inf' is allowed.

     ncp: non-centrality parameter. If omitted the central F is
          assumed.

log, log.p: logical; if TRUE, probabilities p are given as log(p).

lower.tail: logical; if TRUE (default), probabilities are P[X <= x],
          otherwise, P[X > x].

_D_e_t_a_i_l_s:

     The F distribution with 'df1 =' n1 and 'df2 =' n2 degrees of
     freedom has density

 f(x) = Gamma((n1 + n2)/2) / (Gamma(n1/2) Gamma(n2/2)) (n1/n2)^(n1/2) x^(n1/2 - 1) (1 + (n1/n2) x)^-(n1 + n2)/2

     for x > 0.

     It is the distribution of the ratio of the mean squares of n1 and
     n2 independent standard normals, and hence of the ratio of two
     independent chi-squared variates each divided by its degrees of
     freedom.  Since the ratio of a normal and the root mean-square of
     m independent normals has a Student's t_m distribution, the square
     of a t_m variate has a F distribution on 1 and m degrees of
     freedom.

     The non-central F distribution is again the ratio of mean squares
     of independent normals of unit variance, but those in the
     numerator are allowed to have non-zero means and 'ncp' is the sum
     of squares of the means.  See Chisquare for further details on
     non-central distributions.

_V_a_l_u_e:

     'df' gives the density, 'pf' gives the distribution function 'qf'
     gives the quantile function, and 'rf' generates random deviates.

     Invalid arguments will result in return value 'NaN', with a
     warning.

_S_o_u_r_c_e:

     For 'df', and 'ncp == 0', computed via a binomial probability,
     code contributed by Catherine Loader (see 'dbinom'); for 'ncp !=
     0', computed via a 'dbeta', code contributed by Peter Ruckdeschel.

     For 'pf', via 'pbeta' (or for large 'df2', via 'pchisq').

     For 'qf', via 'qchisq' for large 'df2', else via 'qbeta'.

_R_e_f_e_r_e_n_c_e_s:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole.

     Johnson, N. L., Kotz, S. and Balakrishnan, N. (1995) _Continuous
     Univariate Distributions_, volume 2, chapters 27 and 30. Wiley,
     New York.

_S_e_e _A_l_s_o:

     'dchisq' for chi-squared and 'dt' for Student's t distributions.

_E_x_a_m_p_l_e_s:

     ## the density of the square of a t_m is 2*dt(x, m)/(2*x)
     # check this is the same as the density of F_{1,m}
     x <- seq(0.001, 5, len=100)
     all.equal(df(x^2, 1, 5), dt(x, 5)/x)

     ## Identity:  qf(2*p - 1, 1, df)) == qt(p, df)^2)  for  p >= 1/2
     p <- seq(1/2, .99, length=50); df <- 10
     rel.err <- function(x,y) ifelse(x==y,0, abs(x-y)/mean(abs(c(x,y))))
     quantile(rel.err(qf(2*p - 1, df1=1, df2=df), qt(p, df)^2), .90)# ~= 7e-9

