From Two Chi-Square Variables to an F Variable
A chi-square variable records a sum of squared standard normal variables. An F variable is built by comparing two such quantities after each has been divided by its degrees of freedom. This construction makes the F distribution a natural model for a ratio of two independently varying, scaled sums of squares.
The definition involves two degrees of freedom, not one: one belongs to the chi-square variable in the numerator, and the other belongs to the chi-square variable in the denominator. We will derive the distribution of the ratio itself and see exactly where both values enter.
The scaling is part of the definition: the two chi-square variables are each divided by their own degrees of freedom before taking the ratio. For positive integer degrees of freedom, a chi-square variable can be represented as a sum of that many squared, independent standard normal variables. For example, \(U=\sum_{i=1}^{df_1}Z_i^2\) when the \(Z_i\) are independent standard normal variables. To obtain the F distribution from two such sums, the normal variables used for \(U\) must also be independent of those used for \(V\).
For the derivation, we use the chi-square density. If \(U\sim\chi^2_{df_1}\), its density at \(u>0\) is \(f_U(u)=u^{df_1/2-1}e^{-u/2}/(2^{df_1/2}\Gamma(df_1/2))\), where \(\Gamma\) is the gamma function. The density of \(V\) has the same form with \(df_2\) in place of \(df_1\). Independence means their joint density is the product of these two densities.
Worked Example: Constructing an F Ratio From Squared Normals
Suppose, hypothetically, \(U\) is the sum of four squared independent standard normal values \(1,-2,0.5,-1.5\), while \(V\) is the sum of six squared independent standard normal values \(0.5,1,-1.5,2,\sqrt{0.5},-1\). Assume all ten normal variables are mutually independent. Calculate the realized F ratio and identify its distribution.
First calculate each sum of squares: \(U=1^2+(-2)^2+0.5^2+(-1.5)^2=1+4+0.25+2.25=7.5\). Thus \(U\) has \(df_1=4\). Similarly, \(V=0.5^2+1^2+(-1.5)^2+2^2+(\sqrt{0.5})^2+(-1)^2=0.25+1+2.25+4+0.5+1=9\), so \(V\) has \(df_2=6\).
The variables are independent by the stated assumption, and each sum is made from independent standard normal variables, so the chi-square model applies to both. Divide each sum by its degrees of freedom: \(U/df_1=7.5/4=1.875\) and \(V/df_2=9/6=1.5\). The observed ratio is therefore \(F=1.875/1.5=1.25\). The random ratio has an \(F_{4,6}\) distribution; the calculated value 1.25 is one possible realization of that random variable.
Deriving the Density
We can derive the density by transforming the pair \((U,V)\) into the ratio \(F\) and a second variable that keeps track of the denominator chi-square value. Set \(W=V\). Then \(F=(U/df_1)/(V/df_2)\), so \(U=(df_1/df_2)FW\). The pair \((F,W)\) ranges over \(f>0,w>0\).
For \(f\leq 0\), the density is zero. To establish the formula, write \(a=df_1/2\) and \(b=df_2/2\). The transformation from \((f,w)\) to \((u,v)\) is \(u=(df_1/df_2)fw\) and \(v=w\). Its Jacobian determinant in absolute value is \((df_1/df_2)w\), because \(\left|\partial(u,v)/\partial(f,w)\right|=(df_1/df_2)w\). The change-of-variables formula therefore gives the joint density of \(F,W\) as the joint density of \(U,V\), evaluated at \(u=(df_1/df_2)fw,v=w\), multiplied by this Jacobian.
Independence gives \(f_{U,V}(u,v)=f_U(u)f_V(v)\). Substituting the chi-square densities and the transformation yields $$ f_{F,W}(f,w)= \frac{(df_1/df_2)^a f^{a-1}} {2^{a+b}\Gamma(a)\Gamma(b)} w^{a+b-1} \exp\!\left[-\frac{w}{2}\left(1+\frac{df_1}{df_2}f\right)\right], \qquad f,w>0. $$
The density of \(F\) is obtained by integrating over every possible \(w>0\). Let \(c=1+(df_1/df_2)f\). Then $$ f_F(f)= \frac{(df_1/df_2)^a f^{a-1}} {2^{a+b}\Gamma(a)\Gamma(b)} \int_0^\infty w^{a+b-1}e^{-cw/2}\,dw. $$
For \(c>0\), substituting \(t=cw/2\) gives $$ \int_0^\infty w^{a+b-1}e^{-cw/2}\,dw =\left(\frac{2}{c}\right)^{a+b}\Gamma(a+b). $$ The factor \(2^{a+b}\) cancels the \(2^{a+b}\) in the denominator, leaving $$ f_F(f)= \frac{\Gamma(a+b)}{\Gamma(a)\Gamma(b)} \left(\frac{df_1}{df_2}\right)^a f^{a-1} \left(1+\frac{df_1}{df_2}f\right)^{-(a+b)}. $$ Replacing \(a,b\) by \(df_1/2,df_2/2\) gives the stated density.
This derivation also confirms why the assumptions matter. The product joint density used in the first step is valid because \(U\) and \(V\) are independent. Each marginal density is chi-square because the variables being summed are squared independent standard normals. If either condition fails, the derived density does not automatically describe the ratio.
Worked Example: Evaluating an F Density
For a hypothetical ratio with \(df_1=4\) and \(df_2=6\), find the density at \(f=1\). This is a density calculation, not the probability that the ratio equals 1.
Here \(a=df_1/2=2\) and \(b=df_2/2=3\). The gamma values are \(\Gamma(5)=24\), \(\Gamma(2)=1\), and \(\Gamma(3)=2\). Substitution into the density gives $$ f_F(1)= \frac{24}{1\cdot 2} \left(\frac{4}{6}\right)^2 (1)^{2-1} \left(1+\frac{4}{6}\right)^{-5} = 12\cdot\frac{4}{9}\cdot\left(\frac{5}{3}\right)^{-5}. $$
Since \((5/3)^{-5}=243/3125\), the result is \(f_F(1)=16/3\cdot243/3125=1296/3125=0.41472\). The value 0.41472 is the density height at 1; it is not a point probability. Probabilities are areas under the density over intervals.
Why Both Degrees of Freedom Are Needed
The numerator and denominator degrees of freedom specify the two chi-square distributions used to form the ratio. In the density, \(df_1\) appears in the power of \(f\) and in the scale factor \(df_1/df_2\); \(df_2\) appears in that scale factor and in the combined exponent. Thus the distribution is not determined by the numerator degrees of freedom alone, or by the denominator degrees of freedom alone.
For instance, changing \(df_2\) changes the distribution of \(V\), the variable in the denominator, and therefore changes the distribution of the ratio even if the numerator is left unchanged. The pair of degrees of freedom is part of the name \(F_{df_1,df_2}\): both numbers must be reported to identify the distribution. This identification does not mean every ratio with a similar-looking formula has an F distribution; the chi-square and independence conditions are essential.
Worked Example: Same Numerator Degrees of Freedom, Different Denominator Degrees of Freedom
Compare the density at \(f=1\) for \(F_{2,4}\) and \(F_{2,8}\). This comparison holds the numerator degrees of freedom fixed and changes only the denominator degrees of freedom.
For \(F_{2,4}\), \(a=1\) and \(b=2\). The density formula gives $$ f_{F_{2,4}}(1)= \frac{\Gamma(3)}{\Gamma(1)\Gamma(2)} \left(\frac{2}{4}\right)^1 (1)^0 \left(1+\frac{2}{4}\right)^{-3} =2\cdot\frac12\cdot\left(\frac32\right)^{-3} =\frac{8}{27}\approx0.2963. $$
For \(F_{2,8}\), \(a=1\) and \(b=4\). Now $$ f_{F_{2,8}}(1)= \frac{\Gamma(5)}{\Gamma(1)\Gamma(4)} \left(\frac{2}{8}\right)^1 (1)^0 \left(1+\frac{2}{8}\right)^{-5} =4\cdot\frac14\cdot\left(\frac54\right)^{-5} =\left(\frac45\right)^5 =0.32768. $$
The densities differ even though both ratios have numerator degrees of freedom 2. Knowing only that one number would not identify which distribution applies. The computation illustrates the need to specify both degrees of freedom, without treating either as an optional detail.
Common Mistake
A common error is to write \(F=U/V\) and conclude that the ratio has an F distribution simply because both variables are chi-square. The F construction uses scaled chi-square variables: \(F=(U/df_1)/(V/df_2)\). Omitting either divisor changes the random variable and generally changes its distribution. Another error is to assume independence without checking it. The derivation relies on the product of the two chi-square densities, which requires independence.
Check Your Understanding
Answer each question by referring to the construction or density derived above.
- If \(U\sim\chi^2_5\) and \(V\sim\chi^2_9\) are independent, write the ratio that has an F distribution and name that distribution.
- Why does the derivation require independence of \(U\) and \(V\)?
- In the change of variables \(u=(df_1/df_2)fw,\ v=w\), what is the absolute Jacobian determinant?
- What does a density value at \(f=1\) represent, and why is it not \(P(F=1)\)?
- Explain why specifying only the numerator degrees of freedom is not enough to identify an F distribution.