Hexa Scholar

Chi-square, t and F from normals

Three cream bowls hold gold and navy beads on a wooden table, with a wooden scoop beside them.
Bowls of beads and a scoop stand for quantities assembled from common ingredients.

The question

Start with normal draws. Change what you do with them.

  1. 1 SeeSketch a sum of squares.
  2. 2 TryAssemble ratios and test independence.
  3. 3 ProveProve the moments.
  4. 4 ApplyUse normal-sample statistics.
Before you start · 3 quick checks on standardization, independence, and density

Two ideas before you start

2 ideas

One 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.

1 See

Sketch the distribution you expect

The dashed line is your proposed density. The axes show u horizontally and density vertically.

2 Try

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.

3 Prove

Why the sum has these moments

Theorem

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.

Means and variances of t and F

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.

4 Apply

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.

Key point Track the numerator, denominator, degrees of freedom, and independence. The distribution name follows from that construction.
Level IntermediatePrerequisites Normal densities, convolution, and sampling distributions; gamma integrals and orthogonal normal coordinates refreshed hereTime About 35 min

Further reading