Tutorials › VEE Mathematical Statistics › Deriving the F Density by Change of Variables

VEE Mathematical Statistics · F Distribution and Sampling Results · Tutorial 408 of 880

Deriving the F Density by Change of Variables

Learn how a ratio of scaled independent chi-square variables produces the F density, and how to use the transformation correctly.

Intermediate 11 min read

What You'll Learn

  • Define an F variable as a ratio of two scaled, independent central chi-square variables
  • Set up the ratio transformation and calculate its Jacobian
  • Derive the density by integrating out the second transformed variable
  • Use the degrees of freedom and scaling factors correctly in the density
  • Identify common errors in ratios, Jacobians, and density coefficients
  • Apply the derived density in original multi-step problems

Why the F Density Comes From a Ratio

An F variable is built from two independent measures of variation, each scaled by its degrees of freedom. This construction appears naturally when comparing sample variances, but the density is not obtained by simply dividing two chi-square densities. The ratio changes the scale of the variables, so its probability density must account for the corresponding Jacobian.

This tutorial derives that density directly. The main ingredients are the chi-square density, independence, a one-to-one transformation, and integration over the variable that is not part of the ratio. The result is aligned with the SOA VEE Mathematical Statistics syllabus.

Definition: Let \(X\sim\chi^2_m\) and \(Y\sim\chi^2_n\) be independent central chi-square random variables with positive degrees of freedom \(m\) and \(n\). The ratio \(F=(X/m)/(Y/n)\) has an F distribution with numerator degrees of freedom \(m\) and denominator degrees of freedom \(n\), written \(F\sim F_{m,n}\). Its support is \(t>0\).

In applications based on normal samples, \(m\) and \(n\) are usually positive integers. The density derivation also holds for positive real degrees of freedom. The assumptions matter: both chi-square variables must be central and independent, and the ratio must use the stated degree-of-freedom scaling. If a variable is noncentral, or if the two variables are dependent, this derivation does not give the ordinary F density.

Deriving the Density by Change of Variables

For \(x>0\) and \(y>0\), the independent chi-square densities are

$$ f_X(x)=\frac{x^{m/2-1}e^{-x/2}}{2^{m/2}\Gamma(m/2)}, \qquad f_Y(y)=\frac{y^{n/2-1}e^{-y/2}}{2^{n/2}\Gamma(n/2)}. $$

Here \(\Gamma(a)=\int_0^\infty z^{a-1}e^{-z}\,dz\) for \(a>0\). Independence gives the joint density \(f_{X,Y}(x,y)=f_X(x)f_Y(y)\). Set \(T=(X/m)/(Y/n)=nX/(mY)\), and retain \(Y\) as the second transformed variable. Solving for the original variables gives \(x=(m/n)ty\) and \(y=y\).

1
Specify the transformation.
Use \(t=nx/(my)\) and \(w=y\). The inverse transformation is \(x=(m/n)tw,\ y=w\), for \(t>0,\ w>0\).
2
Calculate the Jacobian.
The absolute determinant of the inverse transformation is \(\left|\partial(x,y)/\partial(t,w)\right|=(m/n)w\). This factor is required when converting the joint density.
3
Form the transformed joint density.
Substitute \(x=(m/n)tw\) and \(y=w\) in \(f_X(x)f_Y(y)\), then multiply by the Jacobian.
4
Integrate out \(w\).
Integrate the transformed joint density over \(0<w<\infty\). The result depends only on \(t\), and is the density of \(T\).

The substitution gives the following expression before integration:

$$ f_{T,W}(t,w) = \frac{(m/n)^{m/2}t^{m/2-1}w^{(m+n)/2-1} \exp\!\left[-\frac{w}{2}\left(1+\frac{mt}{n}\right)\right]} {2^{(m+n)/2}\Gamma(m/2)\Gamma(n/2)}. $$

To see the power of \(w\), the two chi-square density powers contribute \(w^{m/2-1}\) and \(w^{n/2-1}\), while the Jacobian contributes one more factor of \(w\). Their combined exponent is \(m/2-1+n/2-1+1=(m+n)/2-1\). This is a useful check on the transformation algebra.

Let \(a=(m+n)/2\) and \(c=(1+mt/n)/2\). The integral over \(w\) is \(\int_0^\infty w^{a-1}e^{-cw}\,dw=\Gamma(a)c^{-a}\), obtained by substituting \(z=cw\) in the defining gamma integral. Applying it yields the F density.

Theorem: If \(X\sim\chi^2_m\) and \(Y\sim\chi^2_n\) are independent, then \(T=(X/m)/(Y/n)\) has density
$$ f_T(t)= \frac{\Gamma\!\left((m+n)/2\right)} {\Gamma(m/2)\Gamma(n/2)} \left(\frac{m}{n}\right)^{m/2} t^{m/2-1} \left(1+\frac{mt}{n}\right)^{-(m+n)/2}, \qquad t>0. $$

For \(t\leq 0\), \(f_T(t)=0\). The degrees of freedom have different roles: \(m\) appears in the power \(t^{m/2-1}\) and in the numerator scaling, while \(n\) appears in the factor \(1+mt/n\) and in the overall exponent. Keeping the order \(F_{m,n}\) straight is essential.

Worked Applications

Worked Example: Evaluating an F Density at One

Let \(X\sim\chi^2_4\) and \(Y\sim\chi^2_2\) be independent, and define \(F=(X/4)/(Y/2)\). Find \(f_F(1)\), reporting the probability density to four decimal places. Name the method and identify a likely error.

Method. Apply the change-of-variables density formula with \(m=4\), \(n=2\), and \(t=1\). The required gamma values are \(\Gamma(3)=2\), \(\Gamma(2)=1\), and \(\Gamma(1)=1\).

The constant before the powers of \(t\) and \(1+mt/n\) is \((4/2)^{4/2}\Gamma(3)/[\Gamma(2)\Gamma(1)]=2^2(2)/(1\cdot1)=8\). The remaining factors at \(t=1\) are \(1^{4/2-1}=1\) and \((1+4/2)^{-3}=3^{-3}=1/27\). Therefore \(f_F(1)=8(1)(1/27)=8/27=0.296296\ldots\), or \(0.2963\) to four decimal places.

Check. The density is positive at \(t=1\), which is in its support. A common error is to omit the coefficient and report \(1/27\). The coefficient is not 1: the gamma ratio and scaling factor together equal 8.

Worked Example: Keeping the Scaling Factors in the Ratio

Let \(X\sim\chi^2_6\) and \(Y\sim\chi^2_4\) be independent. Define \(F=(X/6)/(Y/4)\). Find \(f_F(2)\), rounding to four decimal places. State the method and guard against reversing the numerator and denominator scaling.

Method. This is the ratio \(F_{6,4}\), so use \(m=6\), \(n=4\), and \(t=2\). The scaling factor is \((m/n)^{m/2}=(6/4)^3=(3/2)^3=27/8\). Also, \(\Gamma(5)=24\), \(\Gamma(3)=2\), and \(\Gamma(2)=1\), giving the gamma ratio \(24/(2\cdot1)=12\). Thus the full constant is \((27/8)(12)=81/2=40.5\).

The power of \(t\) is \(2^{6/2-1}=2^2=4\). The final factor is \((1+6(2)/4)^{-(6+4)/2}=(1+3)^{-5}=4^{-5}=1/1024\). Therefore \(f_F(2)=(81/2)(4)(1/1024)=162/1024=81/512=0.158203125\), or \(0.1582\) to four decimal places.

Check. The same ratio written directly is \(F=4X/(6Y)=2X/(3Y)\). Reversing the scaled variables would instead define a different ratio with the degrees of freedom in the opposite order; it would not have the density just calculated.

Worked Example: Integrating a Derived F Density

Let \(X\sim\chi^2_2\) and \(Y\sim\chi^2_4\) be independent, with \(F=(X/2)/(Y/4)\). Find \(P(F>2)\). Show how the density is obtained and how the probability is checked.

Method. Substitute \(m=2\) and \(n=4\) in the derived density. The constant is \((2/4)^1\Gamma(3)/[\Gamma(1)\Gamma(2)]=(1/2)(2)/(1\cdot1)=1\). The power \(t^{m/2-1}\) is \(t^0=1\), and the last factor is \((1+t/2)^{-3}\). Hence \(f_F(t)=(1+t/2)^{-3}\) for \(t>0\).

Integrate the density from 2 to infinity. Since the derivative of \((1+t/2)^{-2}\) is \(-(1+t/2)^{-3}\), \(P(F>2)=\int_2^\infty(1+t/2)^{-3}\,dt=[-(1+t/2)^{-2}]_2^\infty=0-(-1/4)=1/4\). The probability is \(0.2500\) to four decimal places.

Check. Integrating over the full support gives \(\int_0^\infty(1+t/2)^{-3}\,dt=[-(1+t/2)^{-2}]_0^\infty=1\), confirming that the derived expression is normalized. A common mistake is to treat the density value at a point as a tail probability; here the probability comes from integrating over \(t>2\).

Common Traps and a Quick Algebra Check

The Jacobian is a frequent source of errors. Using only \(f_X(x)f_Y(y)\) after substituting the inverse transformation does not give the transformed joint density; the multiplier \((m/n)w\) must also be included. Omitting its factor \(w\) changes the power in the integral, and omitting its constant changes the final coefficient. The resulting expression may look plausible while failing to integrate to one.

Another trap is to confuse a ratio of scaled variables with an unscaled ratio. For example, if \(U\) and \(V\) are positive, direct arithmetic gives \((U/3)/(V/4)=4U/(3V)\), and \((U/6)/(V/8)=4U/(3V)\). Both sides equal \(4U/(3V)\). Neither expression equals \(2U/V\) in general. When identifying an F distribution, simplify the ratio first and verify that each chi-square variable is divided by its own degrees of freedom.

Finally, the density formula has a specified order: \(m\) is the degrees of freedom for the chi-square variable in the numerator of \(F\), and \(n\) is for the denominator. Writing \(F_{n,m}\) instead of \(F_{m,n}\) changes the formula. A practical check is to go back to the definition \(F=(X/m)/(Y/n)\) before substituting values.

Key takeaway: To derive an F density, transform the independent chi-square pair to the ratio and one retained variable, include the inverse Jacobian, and integrate out the retained variable. The scaling \(X/m\) over \(Y/n\) determines which degrees of freedom enter each part of the density.

Check Your Understanding

Work each problem using the ratio definition and the density formula derived above. Give density values to four decimal places where requested.

  1. Independent \(X\sim\chi^2_2\) and \(Y\sim\chi^2_2\) define \(F=(X/2)/(Y/2)\). Find \(f_F(1)\). (Answer: \(0.2500\))
  2. Independent \(X\sim\chi^2_4\) and \(Y\sim\chi^2_6\) define \(F=(X/4)/(Y/6)\). Find \(f_F(1)\). (Answer: \(1296/3125=0.4147\))
  3. Independent \(X\sim\chi^2_6\) and \(Y\sim\chi^2_2\) define \(F=(X/6)/(Y/2)\). Find \(f_F(1)\). (Answer: \(81/256=0.3164\))
  4. Independent \(X\sim\chi^2_4\) and \(Y\sim\chi^2_8\) define \(F=(X/4)/(Y/8)\). Find \(f_F(1)\). (Answer: \(320/729=0.4390\))
  5. Independent \(X\sim\chi^2_2\) and \(Y\sim\chi^2_4\) define \(F=(X/2)/(Y/4)\). Use the density to find \(P(F>4)\). (Answer: \(1/9=0.1111\))
Clinical Biostats