$\newcommand{\N}{\mathcal{N}}\newcommand{\d}{\,\mathrm{d}}$I am trying to understand how the sum of squares of standard normal variables is a $\chi^2$ distribution. Note that I am not a student of probability theory, but am rather trying to make sense of some things in a formal manner from a background of analysis.
As I understand it:$$X\sim\N(0,1)\iff p(X\in I\subset\Bbb R)=\frac{1}{\sqrt{2\pi}}\int_I\exp\left(-\frac{1}{2}x^2\right)\d x$$
Allegedly, if $X_1,X_2,\cdots,X_n\sim\N(0,1)$, then:
$$\sum_{i=1}^nX_i^2\sim\chi_n^2$$
Where:
$$X\sim\chi^2_n\iff p(X\in I\subset\Bbb R^+)=\frac{1}{2^{n/2}\Gamma(n/2)}\int_Ix^{n/2-1}\exp(-x/2)\d x$$
I will try (and fail!) to show this.
The squares of these $X_i$ will lie in $\Bbb R^+$. I will proceed by induction. For $n=1$, we find that $X_1^2\in I\iff X_1\in\pm\sqrt{I}$, so I can make the substitution $x=u^2$ to retrieve the normal pdf of $X_1$. I believe it is a theorem that if two measures agree on all intervals in $\Bbb R$, they agree on all Borel sets - is this true? What's the name of this theorem if it is? I cannot recall, but I think I read this somewhere. Anyway, w.l.o.g (hopefully!) take $I=(a^2,b^2)\subset\Bbb R^+$ : $$\begin{align}p(X_1^2\in I)&=\int_{a^2}^{b^2}\mathrm{pdf}_{X_1^2}(x)\d x=\frac{1}{2}\left(\int_a^b2x\cdot\mathrm{pdf}_{X_1}(x)\d x+\int_{-b}^{-a}2x\cdot\mathrm{pdf}_{X_1}(x)\d x\right)\\&=\frac{1}{\sqrt{2\pi}}\left(\int_a^b x\exp(-\frac{1}{2}x^2)\d x+\int_{-b}^{-a}x\exp(-\frac{1}{2}x^2)\d x\right)\\&=\frac{1}{\sqrt{2\pi}}\left(\int_{a^2}^{b^2}\sqrt{u}\cdot\exp(-\frac{1}{2}u)(\frac{1}{2}u^{-1/2}\d u)-\int_{b^2}^{a^2}\sqrt{u}\cdot\exp(-\frac{1}{2}u)(\frac{1}{2}u^{-1/2}\d u)\right)\\&=\frac{1}{\sqrt{2\pi}}\int_{a^2}^{b^2}\exp(-\frac{1}{2}u)\d u\end{align}$$ But this is not consistent with the assertion that $X_1^2\sim\chi^2_1$, since the integral is missing a $u^{-1/2}$ term.
I have two questions:
- What's my mistake in the analysis of the case $n=1$?
- To put my mind at rest, to show that the two distributions are the same over all Borel sets in $\Bbb R$, is it really sufficient to show equivalence over intervals?
Many thanks.
In your second equality you don't need to do a change of variables. You end up doing another change of variables when switching to $u$, which is the only substitution you actually need to do. \begin{align} P(X_1^2 \in [a^2, b^2]) &= P(X_1 \in [a,b] \cup [-b, -a]) \\ &= \int_{[a,b] \cup [-b, -a]} f_{X_1}(x) \, dx \\ &= 2 \int_a^b f_{X_1}(x) \, dx & \text{symmetry} \\ &= 2 \int_{a^2}^{b^2} \frac{1}{2\sqrt{u}} f_{X_1}(\sqrt{u}) \, du & u=x^2 \\ &= \int_{a^2}^{b^2} \frac{1}{\sqrt{2\pi}} u^{-1/2} e^{-u/2} \, du. \end{align}
Regarding upgrading "agreement on integrals" to "agreement on Borel sets," see Carathéodory's Extension Theorem.