Why the Sum Has a Chi-Square Distribution
A sum of squared normal values is always nonnegative, but that fact alone does not determine its probability distribution. To identify the distribution, we need to know how squaring changes a normal density and what happens when independent squared values are added. Those steps explain why the chi-square family arises and why its degrees of freedom count the independent terms.
The result is useful whenever a statistic can be expressed as a sum of squared, standardized normal quantities. The conditions matter: the quantities must be standard normal and mutually independent. A sum that merely looks like a sum of squares does not automatically have a chi-square distribution.
Here, \(N(0,1)\) means a normal distribution with mean 0 and variance 1. The square of a standard normal has a gamma density with shape \(1/2\) and scale 2; adding independent variables with that density adds their shape parameters. The derivation below establishes both facts, rather than relying on the appearance of the sum.
From One Standard Normal to Its Square
Let \(Z\sim N(0,1)\), and define \(Y=Z^2\). Since every square is nonnegative, \(Y\) can only take values \(y\geq 0\). For any \(y>0\), there are two possible values of \(Z\) that produce \(Y=y\): \(z=\sqrt{y}\) and \(z=-\sqrt{y}\). The change-of-variables formula adds the density contributions from both roots, accounting for the derivative of each inverse transformation.
The two contributions are equal because the standard normal density is symmetric. For \(y<0\), the density is zero. The factor \(1/\sqrt{y}\) is important: it appears because the inverse transformation has derivative magnitude \(1/(2\sqrt{y})\), which changes with \(y\).
To recognize this density, define the gamma function for \(a>0\) by \(\Gamma(a)=\int_0^\infty t^{a-1}e^{-t}\,dt\). In particular, \(\Gamma(1/2)=\sqrt{\pi}\). A gamma density with shape \(a\) and scale 2 is \[ f(y)=\frac{y^{a-1}e^{-y/2}}{2^a\Gamma(a)},\qquad y>0. \] Setting \(a=1/2\) gives exactly the density of \(Z^2\). Thus each squared standard normal is gamma with shape \(1/2\) and scale 2.
Worked Example: Squaring Three Independent Standard Normals
Suppose, hypothetically, that three independent standardized measurement errors are represented by \(Z_1,Z_2,Z_3\), each distributed as \(N(0,1)\). For one possible set of values, suppose the errors are \(-1.2,\ 0.5,\) and \(1.1\). Form the sum of their squares and identify the distribution of the random sum before observation.
The random quantity is \(Q=Z_1^2+Z_2^2+Z_3^2\). Its observed value for the stated values is \[ Q=(-1.2)^2+(0.5)^2+(1.1)^2=1.44+0.25+1.21=2.90. \]
The distributional conclusion follows from the model, not from the particular observed value. There are three independent standard normal terms, so \(Q\sim\chi^2_3\). The observed statistic is 2.90; it is not itself a distribution. Independence and standard normality are both part of the stated hypothetical model.
Why Adding the Squares Adds Degrees of Freedom
The density of one square is a gamma density with shape \(1/2\). To see what happens when two such variables are added, more generally consider independent gamma variables \(U\) and \(V\), both with scale 2 and with shapes \(a>0\) and \(b>0\). Their sum \(S=U+V\) has density given by convolution:
Substituting the two gamma densities and collecting the factors gives
Use the substitution \(t=x/s\), so \(x=st\) and \(dx=s\,dt\). The integral becomes \(s^{a+b-1}\int_0^1 t^{a-1}(1-t)^{b-1}\,dt\). The integral over \(t\) is the beta integral \(B(a,b)\), and \(B(a,b)=\Gamma(a)\Gamma(b)/\Gamma(a+b)\). This identity follows by writing \(\Gamma(a)\Gamma(b)\) as a double integral and changing variables from its two positive integration variables \(u,v\) to \(r=u+v\) and \(t=u/(u+v)\). The Jacobian is \(r\), so the double integral factors into \(\Gamma(a+b)\) times the beta integral.
Substituting that identity into the convolution yields
This is a gamma density with shape \(a+b\) and scale 2. Therefore, when independent squared standard normals are added, their gamma shapes add. Each contributes \(1/2\), so \(k\) terms produce shape \(k/2\). The resulting density is
This is the chi-square density with \(k\) degrees of freedom. The argument starts with one squared normal and applies the addition result repeatedly. It is the distributional derivation: the chi-square form follows from the normal density, the squaring transformation, and independence in the convolution.
Worked Example: Standardizing Measurements Before Squaring
Consider a hypothetical model for three independent instrument readings. The readings \(X_1,X_2,X_3\) are normal with respective means 10, 20, and 100 units, and standard deviations 2, 5, and 10 units. Suppose one set of readings is 12, 15, and 110 units. Assuming those model conditions hold, form the sum of squared standardized readings and identify its distribution.
Standardize each reading by subtracting its model mean and dividing by its model standard deviation: \[ Z_1=\frac{12-10}{2}=1,\qquad Z_2=\frac{15-20}{5}=-1,\qquad Z_3=\frac{110-100}{10}=1. \] Each \(Z_i\) has a standard normal distribution under the stated normal model. The standardized values remain independent because each is a transformation of a different independent reading.
The sum of squares for these readings is \[ Q=Z_1^2+Z_2^2+Z_3^2=1^2+(-1)^2+1^2=3. \] Before the readings are observed, the random sum has a chi-square distribution with three degrees of freedom: \(Q\sim\chi^2_3\). The degrees of freedom count the three independent standardized readings, not the number of distinct numerical values in this particular set.
What the Degrees of Freedom Count
In this construction, the degrees of freedom have a direct interpretation: there are \(k\) independently varying standard normal components, and each contributes one squared term. The count is not a correction or a label chosen after calculating the sum. It determines the gamma shape, and therefore the density of the sum.
The expected value and variance also show the contribution of each term. For a standard normal variable, \(E(Z^2)=1\) and \(E(Z^4)=3\); these moments follow from integration by parts in the normal density. Thus \(\operatorname{Var}(Z^2)=E(Z^4)-[E(Z^2)]^2=3-1=2\). For independent terms, expectations and variances add, giving
Every added independent squared standard normal increases the mean of the sum by 1 and its variance by 2. These formulas agree with the gamma density above. They also help explain why the number of independent terms matters, although matching a mean and variance alone would not prove that a variable is chi-square.
Worked Example: Checking the Degrees of Freedom for Four Terms
Suppose, hypothetically, a statistic is constructed as \(Q=Z_1^2+Z_2^2+Z_3^2+Z_4^2\), where the four \(Z_i\) are independent and each follows \(N(0,1)\). Identify its degrees of freedom, and calculate the mean and variance of \(Q\).
There are four independent standard normal terms, so \(Q\sim\chi^2_4\). Using the contribution of each term, \[ E(Q)=4(1)=4,\qquad \operatorname{Var}(Q)=4(2)=8. \]
For example, if one possible set of standardized values is \(0.5,-1,1.5,0\), its observed sum is \[ Q=(0.5)^2+(-1)^2+(1.5)^2+0^2=0.25+1+2.25+0=3.50. \] The model still assigns the random sum a chi-square distribution with four degrees of freedom. The observed value 3.50 is one realization; it does not change the number of terms or the model distribution.
Conditions and a Common Mistake
The derivation depends on two essential conditions: each term must be standard normal, and the terms must be mutually independent. If independent normal measurements have different means and standard deviations, standardizing each by its own mean and standard deviation produces standard normal terms. If the terms are dependent, the convolution argument does not apply. If they are not centered at zero after standardization, the central chi-square result given here does not apply.
Worked Example: Why Dependence Changes the Result
Imagine, hypothetically, that two instruments record the same underlying random error \(Z\), so their standardized errors are \(Z_1=Z\) and \(Z_2=Z\), with \(Z\sim N(0,1)\). Each instrument's error is individually standard normal, but the two errors are perfectly dependent. Compare their sum of squares with a chi-square variable with two degrees of freedom.
Here the sum is \(Q=Z_1^2+Z_2^2=2Z^2\). Using \(E(Z^2)=1\) and \(\operatorname{Var}(Z^2)=2\), \[ E(Q)=2,\qquad \operatorname{Var}(Q)=4\operatorname{Var}(Z^2)=4(2)=8. \] A chi-square variable with two degrees of freedom has mean 2 and variance \(2(2)=4\). The variances differ, so \(Q\) cannot have that chi-square distribution. The fact that there are two recorded terms is not enough: they must also be independent.
Common mistake: “There are \(k\) squared values, so their sum must have a chi-square distribution with \(k\) degrees of freedom.” The correction is to check the model for each term and the relationship among terms. The result requires \(k\) independent standard normal variables. Merely squaring \(k\) numbers, or even \(k\) individually normal but dependent variables, does not establish a chi-square distribution.
Check Your Understanding
Use the density derivation and model conditions to answer these questions.
- Why does the density of \(Z^2\) include contributions from both \(\sqrt{y}\) and \(-\sqrt{y}\)?
- Four independent standard normal variables are squared and added. What are the degrees of freedom, and what is the expected value of the sum?
- Three independent normal measurements have different means and standard deviations. What must be done to each measurement before using the chi-square result?
- Two individually standard normal variables are dependent. Is their sum of squares necessarily chi-square? Explain which condition is in question.
- In the four-term example, does an observed sum of 3.50 mean the random sum has 3.50 degrees of freedom? Explain.