# A note on the F-distribution

Some important distributions in statistical applications are of the form $T=\frac{X}{Y}$ where $X$ and $Y$ are independent and $Y >0$. When $X=\frac{U}{m}$ and $Y=\frac{V}{n}$ where $U$ and $V$ have chi-square distributions with degrees of freedom $m$ and $n$, respectively, the ratio $\displaystyle T$ has an F distribution and this ratio is called the F-statistic.

Let $f(x)$ and $g(y)$ be the density functions of the independent random variables $X$ and $Y$, respectively. Let $F(x)$ and $G(y)$ be the distribution functions of $X$ and $Y$, respectively. Let $\displaystyle T=\frac{X}{Y}$ where $Y>0$. We have $P[T \leq t]=P[X \leq tY]$. Integrating over the region of $x \leq ty$, we obtain the following.

\displaystyle \begin{aligned}F_T(t)=P[X \leq tY]&=\int_0^\infty \int_0^{ty} f(x) \thinspace g(y) \thinspace dx \thinspace dy\\&=\int_0^\infty g(y) \int_0^{ty} f(x) dx \thinspace dy\\&=\int_0^\infty F(ty) \thinspace g(y) \thinspace dy\end{aligned}

Taking the derivative, we obtain $\displaystyle f_T(t)=F_T^{'}(t)=\int_0^\infty y \thinspace f(ty) \thinspace g(y) \thinspace dy$.

This above derivation of the density function $f_T$ is found in [1].

The F-statistic
Note that a chi-square distribution with $k$ degrees of freedom (denoted by $\chi^2(k)$) is a gamma distribution with parameters $\alpha=\frac{k}{2}$ and $\beta=\frac{1}{2}$ where $k$ is a positive integer. Suppose $X=\frac{U}{m}$ and $Y=\frac{V}{n}$ where $U$ and $V$ have chi-square distributions with $m$ and $n$ as degrees of freedom, respectively. The following are the pdfs of $U$ and $V$:

$\displaystyle f_U(y)=\frac{0.5^{0.5m}}{\Gamma(0.5m)} y^{0.5m-1} e^{-0.5y}$

$\displaystyle f_V(y)=\frac{0.5^{0.5n}}{\Gamma(0.5n)} y^{0.5n-1} e^{-0.5y}$

In general, if $Z=a W$ where $a \neq 0$ is a constant, then we have this relationship for the density functions between $Z$ and $W$: $f_Z(z)=f_W(\frac{z}{a}) \frac{1}{a}$. Then the following are the density functions of $X$ and $Y$. Note that $X$ has a gamma distribution with parameters $\alpha=\frac{m}{2}$ and $\beta=\frac{m}{2}$. For $Y$, it is a gamma distribution with parameters $\alpha=\frac{n}{2}$ and $\beta=\frac{n}{2}$.

$\displaystyle f_X(y)=f_U(my)m=m \frac{0.5^{0.5m}}{\Gamma(0.5m)} (my)^{0.5m-1} e^{-0.5my}$
$\displaystyle =\frac{(0.5m)^{0.5m}}{\Gamma(0.5m)} y^{0.5m-1} e^{-(0.5m)y}$

$\displaystyle f_Y(y)=f_V(ny)n=\frac{(0.5n)^{0.5n}}{\Gamma(0.5n)} y^{0.5n-1} e^{-(0.5n)y}$

Using $\displaystyle f_T(t)=\int_0^\infty y \thinspace f_X(ty) \thinspace f_Y(y) \thinspace dy$, the following is the derivation of the density function of $T=\frac{X}{Y}$:

$\displaystyle f_T(t)=\int_0^{\infty} y \frac{(0.5m)^{0.5m}}{\Gamma(0.5m)} (ty)^{0.5m-1} e^{-(0.5m)ty} \frac{(0.5n)^{0.5n}}{\Gamma(0.5n)} y^{0.5n-1} e^{-(0.5n)y} dy$

$\displaystyle =\int_0^{\infty} \frac{(0.5m)^{0.5m}}{\Gamma(0.5m)} \frac{(0.5n)^{0.5n}}{\Gamma(0.5n)} t^{0.5m-1} y^{0.5m+0.5n-1} e^{-(0.5mt+0.5n)y} dy$

$\displaystyle =\frac{(0.5m)^{0.5m}}{\Gamma(0.5m)} \frac{(0.5n)^{0.5n}}{\Gamma(0.5n)} t^{0.5m-1} \frac{\Gamma(0.5m+0.5n)}{(0.5mt+0.5n)^{0.5mt+0.5n}} \times$

$\displaystyle \int_0^{\infty} \frac{(0.5mt+0.5n)^{0.5m+0.5n}}{\Gamma(0.5m+0.5n)}y^{0.5m+0.5n-1} e^{-(0.5mt+0.5n)y} dy$

$\displaystyle =\frac{(0.5m)^{0.5m}}{\Gamma(0.5m)} \frac{(0.5n)^{0.5n}}{\Gamma(0.5n)} t^{0.5m-1} \frac{\Gamma(0.5m+0.5n)}{(0.5mt+0.5n)^{0.5m+0.5n}}$

Simplifying the above, we obtain:

$\displaystyle f_T(t)=\frac{\Gamma(\frac{m+n}{2})}{\Gamma(\frac{m}{2}) \Gamma(\frac{n}{2})} \thinspace \frac{(\frac{m}{n})^{\frac{m}{2}} \thinspace t^{\frac{m}{2}-1}}{(\frac{m}{n}t+1)^{\frac{m+n}{2}}}$

The distributon derived above is said to be an F distribution with $m$ and $n$ degrees of freedom. The first parameter is the degrees of freedom in the numerator and the second parameter is the degrees of freedom in the denominator.

Reference

1. Feller W., An Introduction to Probability Theory and Its Applications, Vol II, Second Edition, John Wiley & Sons (1971)