Skip to content
Glacius
ProbabilityConcept reference

Chi-squared distributions

A chi-squared variable with n degrees of freedom is the sum of squares of n independent standard-normal variables.

On this page 9 sections
  1. Overview
  2. Understand the idea
  3. Square each input before adding
  4. Independent normals use (mean, variance): Asim N(2,4) and Bsim N(-1,9)
  5. A closer look
  6. Key takeaway
  7. Further questions
  8. Sources & further reading
  9. Concept connections

01Understand the idea#

A chi-squared distribution describes a sum of squares of independent standard-normal variables. Squaring removes signs, so the result cannot be negative. The number of independent squared inputs is called its degrees of freedom.

This construction appears when aggregating standardized errors or estimating variance under normal assumptions. The degrees of freedom describe the random construction, not how many of the realized values happen to be nonzero.

Each input is standard normal, and the inputs are independent. Squaring each one and adding gives a chi-squared variable.

Independent standard-normal inputs Z1, Z2 and Z3 are squared separately. Their squares feed a sum Q with chi-square distribution and 3 degrees of freedom.Independent standard-normal inputs Z1, Z2 and Z3 are squared separately. Their squares feed a sum Q with chi-square distribution and 3 degrees of freedom.
Figure 1Independent standard-normal inputs Z1, Z2 and Z3 are squared separately. Their squares feed a sum Q with chi-square distribution and 3 degrees of freedom.
Link to this figure ↗Download SVGDownload PNG

The degrees of freedom count the independent squared inputs. Three inputs give χ32\chi^2_3; their realized numeric values do not change that count.

Q=Z12+Z22+Z32Q=Z_1^2+Z_2^2+Z_3^2

For independent standard-normal Z1,Z2,Z3Z_1,Z_2,Z_3, the sum Q=Z12+Z22+Z32Q=Z_1^2+Z_2^2+Z_3^2 has three degrees of freedom. If one realization is (1,2,0)(1,-2,0), its sum is 1+4+0=51+4+0=5. The observed value is 5 while the degrees of freedom remain 3.

Check your reasoning

Z1,,Z5Z_1,\ldots,Z_5 are mutually independent N(0,1)N(0,1). Q=i=15Zi2Q=\sum_{i=1}^5Z_i^2. Choose its law.

  1. Aχ252\chi^2_{25}
  2. Bχ52\chi^2_5
  3. CN(0,5)N(0,5)
Show answer and explanation
χ52\chi^2_5

Five independent squares give χ52\chi^2_5.

02Square each input before adding#

Square each input before adding. Squaring the sum adds cross terms, and repeating one input does not create another independent input.

Check your reasoning

Independent Z1,Z2,Z3N(0,1)Z_1,Z_2,Z_3\sim N(0,1). Repair the squared sum for χ32\chi^2_3.

  1. A(Z1+Z2+Z3)2(Z_1+Z_2+Z_3)^2
  2. BZ12+Z22Z_1^2+Z_2^2
  3. CZ12+Z22+Z32Z_1^2+Z_2^2+Z_3^2
Show answer and explanation
Z12+Z22+Z32Z_1^2+Z_2^2+Z_3^2

Square separately, then add.

03Independent normals use (mean, variance): Asim N(2,4) and Bsim N(-1,9)#

Independent normals use (mean, variance): AN(2,4)A\sim N(2,4) and BN(1,9)B\sim N(-1,9). Subtract each mean and divide by its SD.

U=(A2)/2V=(B+1)/3\begin{gathered}U=(A-2)/2\\V=(B+1)/3\end{gathered}

For independent AN(2,4)A\sim N(2,4) and BN(1,9)B\sim N(-1,9), let U=(A2)/2U=(A-2)/2 and V=(B+1)/3V=(B+1)/3. These are independent standard normals.

Q=U2+V2χ22Q=U^2+V^2\sim\chi^2_2

Divide by SD, not variance, before squaring.

Check your reasoning

Independent normals (mean, variance): AN(0,4)A\sim N(0,4); BN(0,9)B\sim N(0,9). Q=(A/2)2+(B/3)2Q=(A/2)^2+(B/3)^2. Choose its law.

  1. Aχ22\chi^2_2
  2. Bχ42\chi^2_4
  3. CN(0,2)N(0,2)
Show answer and explanation
χ22\chi^2_2

Two squares give χ22\chi^2_2.

04A closer look#

Before squaring a nonstandard normal variable, subtract its mean and divide by its standard deviation. Independence is also essential for this stated chi-squared construction. Reusing one variable twice does not create two independent contributions.

Key takeaway

Standardize each normal input, square separately, then add. Degrees of freedom count the independent squared inputs.

  • Identify a chi-squared variable as a sum of squared independent standard-normal variables.

Further questions

What changes when a normal value is divided by a random chi-squared scale?
If Z is standard normal and V is an independent chi-squared variable with nu degrees of freedom, Z divided by sqrt(V/nu) has a Student t distribution with nu degrees of freedom.

Sources & further reading

  1. [1]
  2. [2]

Reference this concept

Link to this page, a section, or an individual figure.

Glacius. “Chi-squared distributions.” Math behind ML. /learn/p-chi-squared