Chi-square, t and F from normals

The question
Start with normal draws. Change what you do with them.
- 1 SeeSketch a sum of squares.
- 2 TryAssemble ratios and test independence.
- 3 ProveProve the moments.
- 4 ApplyUse normal-sample statistics.
Before you start · 3 quick checks on standardization, independence, and density
Two ideas before you start
2 ideasOne common input distribution
A standard normal density and a dashed marker at a selected value.
Move the marker. Its height is a density, not the probability of that single value.
Exact definition
A standard normal variable Z has mean zero, variance one, and density
\[\varphi(z)=\frac{e^{-z^2/2}}{\sqrt{2\pi}}.\]The normal distribution lesson explains standardization and areas under this curve. Here each fresh input has this same distribution. Uppercase letters name random quantities before drawing; lowercase letters name their observed values. The marker shows a possible value, not a simulated observation.
Square a value before adding it
The curve y = z² and a marker at a selected input.
Choose an input. Squaring records its magnitude and discards its sign.
Exact definition
For independent standard normals \(Z_1,\ldots,Z_k\), define
\[U=\sum_{i=1}^k Z_i^2.\]The distribution of U is called chi-square with k degrees of freedom, written \(\chi^2_k\). Here k is a positive integer counting independent squared coordinates. This definition does not say that the square of a sum has the same distribution. Expand before replacing one expression by the other.
Refresher: independence and sums
Independent variables have a joint density equal to the product of their densities. Functions of disjoint independent groups remain independent. Reusing a draw in two expressions generally creates dependence, even when each expression separately has the desired distribution.
For independent variables with densities, the density of their sum is the convolution of the input densities. The convolution lesson builds that integral. Here convolution acts on squared normals, so its inputs differ from the original normal densities. A distribution of a statistic describes repeated fresh samples, as in sampling distributions.
Sketch the distribution you expect
- Choose how many independent standard normals to square and add.
- Drag the density handles, or focus one and use the arrow keys, then check your sketch.
- Changing the count or pressing Start over clears the revealed result.
The bars estimate density: divide the count in each bin by the total number of repetitions and by the bin width. A bar's area estimates a probability. The curve comes from the formula below, so it has no sampling noise. The sketch is a proposal and is not automatically normalized. Its score checks the handle locations only.
The chi-square density and its shape
For u positive,
\[f_k(u)=\frac{u^{k/2-1}e^{-u/2}}{2^{k/2}\Gamma(k/2)}.\]It is zero for negative u. Here \(\Gamma(a)=\int_0^\infty x^{a-1}e^{-x}\,dx\), for a positive. This integral generalizes factorials: \(\Gamma(a+1)=a\Gamma(a)\) and \(\Gamma(1/2)=\sqrt\pi\). These facts are enough to evaluate the half-integer arguments used here.
For k above two, differentiating the log density gives an interior mode at k minus two. At two the density decreases from the boundary. At one it grows without bound as u approaches zero from the right, while still having finite area. The sketch choices avoid that singular endpoint. No chi-square distribution assigns positive probability to the single value zero.
As k grows, the raw sum moves right and its absolute spread grows. Its relative spread shrinks. Those are different comparisons: an increasingly concentrated average does not imply a decreasing variance for the unscaled sum.
Assemble a ratio
Before using a new name for a ratio, examine how its ingredients were drawn. The next question deliberately reuses one of them.
Let Z be standard normal, U have distribution \(\chi^2_k\), and V have distribution \(\chi^2_m\). For the t recipe, Z and U must be independent. For the F recipe, U and V must be independent.
\[\begin{aligned}T&=\frac{Z}{\sqrt{U/k}}\sim t_k,\\F&=\frac{U/k}{V/m}\sim F_{k,m}.\end{aligned}\]The first F subscript belongs to the numerator, and the second to the denominator. Each sum is divided by its own degrees of freedom before taking the ratio. The t denominator takes a square root, so it is on the scale of a standard deviation; in a normal sample it is \(S/\sigma\). The F denominator is a normalized sum of squares itself.
- Choose a recipe and its degrees of freedom. The F explorer uses equal degrees in both groups.
- Switch between independent ingredients and a shared ingredient, then compare the bars with the independent density.
With independent inputs, a small denominator can magnify a numerator. Student's t is symmetric about zero and has heavier tails than the standard normal. As its degrees of freedom grow, the random scale concentrates near one and t approaches the standard normal in distribution. Heavy tails have a price: a t variable with k degrees has a variance only when k is greater than two (see 3 Prove). F is positive and generally asymmetric; swapping its two degrees of freedom corresponds to taking its reciprocal.
Turning independence off here specifies a particular shared-input construction. It is not a simulation of every possible dependent model. The reference curve remains the independent density so the disagreement is visible. A narrow plot window does not remove probability outside it; the text counts all omitted observations.
Why the sum has these moments
Let k be an integer at least two. Let \(Z_1,\ldots,Z_k\) be independent standard normals and \(U=\sum_i Z_i^2\). Then
\[\begin{aligned}E[U]&=k,&\operatorname{Var}(U)&=2k,\\E[U/k]&=1,&\operatorname{Var}(U/k)&=2/k.\end{aligned}\]The same formulas hold for k = 1; the proof builder assumes k ≥ 2 only so that its wrong alternatives stay false. The proof uses linearity of expectation, independence for variance addition, and integration by parts. For the standard normal density, \(\varphi'(z)=-z\varphi(z)\); polynomial multiples of this density vanish at both infinite endpoints. Thus its even moments can be reduced by integration by parts. All moments used below are finite.
Select the next true equation. A subscript i refers to any one input; sums run over all k inputs. The assumptions also explain why the wrong alternatives remain distinct.
Let \(T=Z/\sqrt{U/k}\) with \(Z\) standard normal independent of \(U\sim\chi^2_k\), and let \(F=(U/k)/(V/m)\) with \(U\sim\chi^2_k\) independent of \(V\sim\chi^2_m\). Then
\[\begin{aligned}E[T]&=0\quad(k\gt1),\\\operatorname{Var}(T)&=\frac{k}{k-2}\quad(k\gt2),\\E[F]&=\frac{m}{m-2}\quad(m\gt2),\\\operatorname{Var}(F)&=\frac{2m^2(k+m-2)}{k(m-2)^2(m-4)}\\&\quad(m\gt4).\end{aligned}\]Outside these ranges the moment does not exist as a finite number. The reason is the denominator. For \(U\sim\chi^2_k\), the integral \(E[1/U]=\int_0^\infty u^{-1}f_k(u)\,du\) behaves like \(\int_0 u^{k/2-2}\,du\) near zero, so it is finite only for k greater than two, and then it equals \(1/(k-2)\). By independence, \(E[T^2]=k\,E[Z^2]\,E[1/U]\), which equals \(k/(k-2)\). For k at most two, \(E[T^2]\) is infinite. For k = 1, t is the Cauchy distribution and even \(E[|T|]\) is infinite, so T has no mean. In the same way \(E[F]=E[U/k]\,E[m/V]\), which equals \(m/(m-2)\), which needs only the denominator degrees m to exceed two. In general \(E[|T|^r]\) is finite exactly when r is less than k, because the t density decays like \(|t|^{-(k+1)}\).
Where the density formulas come from
For a positive u, the equation \(z^2=u\) has two roots. Each contributes a normal density times the absolute derivative of its inverse branch. Their sum gives
\[f_1(u)=\frac{\varphi(\sqrt u)}{\sqrt u}.\]This is a gamma density with shape one half and scale two. Convolving independent gamma densities with the same scale adds their shapes. One way to verify that rule is to substitute x = uv into the convolution integral; the remaining integral over v is the beta integral. Repeating the rule gives the displayed chi-square density.
For t, condition on U = u in the density calculation. The map from Z to T rescales by \(\sqrt{u/k}\), so independence yields
\[\begin{aligned}f_T(t)=\int_0^\infty&\varphi(t\sqrt{u/k})\\&\cdot\sqrt{u/k}\,f_k(u)\,du.\end{aligned}\]Combining the powers of u and the exponentials turns this into another gamma integral:
\[\begin{aligned}f_T(t)&=\frac{\Gamma((k+1)/2)}{\sqrt{k\pi}\,\Gamma(k/2)}\\&\quad\cdot(1+t^2/k)^{-(k+1)/2}.\end{aligned}\]For F, hold V = v fixed and substitute \(u=kvf/m\). The Jacobian factor is kv/m. Integrating the product of the two chi-square densities gives, for f positive,
\[\begin{aligned}f_F(f)&=\frac{\Gamma((k+m)/2)}{\Gamma(k/2)\Gamma(m/2)}\\&\quad\cdot(k/m)^{k/2}f^{k/2-1}\\&\quad\cdot(1+kf/m)^{-(k+m)/2}.\end{aligned}\]These integrations explain the overlays. They also identify exactly where independence is needed: it makes the conditional input density equal to its marginal density. Squaring an independent t recipe gives \(T^2\sim F_{1,k}\), because \(Z^2\sim\chi^2_1\) remains independent of U.
Why a fitted sample mean costs one degree
For iid observations from \(N(\mu,\sigma^2)\), with \(\sigma\gt0\) and sample size n at least two, define
\[S^2=\frac{\sum_i(X_i-\bar X)^2}{n-1}.\]Rotate the standardized vector \(((X_i-\mu)/\sigma)_i\) by an orthogonal matrix whose first row is \((1,\ldots,1)/\sqrt n\). The first new coordinate is \(\sqrt n(\bar X-\mu)/\sigma\). The squares of the other n − 1 coordinates add up to \(\sum_i(X_i-\bar X)^2/\sigma^2\). A standard multivariate normal keeps independent standard normal coordinates under an orthogonal transformation. There are n minus one residual coordinates, so
\[\begin{aligned}\frac{(n-1)S^2}{\sigma^2}&\sim\chi^2_{n-1},\\\frac{\bar X-\mu}{S/\sqrt n}&\sim t_{n-1}.\end{aligned}\]The mean coordinate is independent of the residual coordinates. This normal-specific fact supplies the independence in the t recipe. Subtracting a sample mean creates residuals that sum to zero; counting all of them as independent would be a mistake. For nonnormal populations these exact distribution statements need not hold.
Identify the ingredients before computing
Use what you found above. Each problem has hints and a worked solution. Enter a decimal without units; each answer box states its accepted absolute error. A statistic's value and its reference distribution are separate pieces of the calculation.
Further reading
- G. Casella and R. L. Berger, Statistical Inference, chapter 5, Properties of a Random Sample.
- J. K. Blitzstein and J. Hwang, Introduction to Probability, chapter 8, Transformations.