\Header{FDist}{The F Distribution}
\alias{df}{FDist}
\alias{pf}{FDist}
\alias{qf}{FDist}
\alias{rf}{FDist}
\keyword{distribution}{FDist}
\begin{Usage}
\begin{verbatim}
df(x, df1, df2)
pf(q, df1, df2, ncp=0)
qf(p, df1, df2)
rf(n, df1, df2)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{x,q}] vector of quantiles.
\item[\texttt{p}] vector of probabilities.
\item[\texttt{n}] number of observations to generate.
\item[\texttt{df1,df2}] degrees of freedom.
\item[\texttt{ncp}] non-centrality parameter.
\end{ldescription}
\end{Arguments}
\begin{Value}
These functions provide information about the F distribution with
\texttt{df1} and \texttt{df2} degrees of freedom (and optional non-centrality
parameter \texttt{ncp}).
\texttt{df} gives the density,
\texttt{pf} gives the distribution function
\texttt{qf} gives the quantile function
and
\texttt{rf} generates random deviates.

The F distribution with \texttt{df1 =} \eqn{n_1}{n1} and \texttt{df2 =}
\eqn{n_2}{n2} degrees of freedom has density
\deqn{
f(x) = \frac{\Gamma(n_1/2 + n_2/2)}{\Gamma(n_1/2)\Gamma(n_2/2)}
\left(\frac{n_1}{n_2}\right)^{n_1/2} x^{n_1/2 -1}
\left(1 + \frac{n_1 x}{n_2}\right)^{-(n_1 + n_2) / 2}
}{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 \eqn{x > 0}{}.\end{Value}
\begin{SeeAlso}
\texttt{\Link{dt}} for Student's t distribution, the square of which is
(almost) equivalent to the F distribution with \texttt{df2} \eqn{= 1}{}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
df(1,1,1) == dt(1,1)# TRUE

## 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
\end{ExampleCode}
\end{Examples}

