# How is the $\chi^2$ distribution defined at 0 for various degrees of freedom?

I'm trying to understand the $\chi^2$-distribution. Wikipedia has the following graph for the probability density function:

This graph shows that for $k = 1$, the PDF will be... infinite? The mode of the $\chi^2$-distribution is defined as $max \{k − 2, 0\}$, so $f_1(0) = ?$

In other graphs on the Web, it seemed like it even went higher than $1$. Like here:

Of course, the cumulative distribution function approaches $1$ for all degrees of freedom:

I don't understand why the probability distribution function behaves like that around $0$ for any $k$. How is the $\chi^2$-distribution defined around $0$?

• Have you looked at the formula for its density? That immediately and completely answers your question.
– whuber
Commented Jul 12, 2016 at 19:43
• I get a sense that what you are really asking is whether it makes sense for the CDF to be bounded at 1, when the PDF goes to infinity at zero. Is that it? Commented Jul 12, 2016 at 20:14
• @AntoniParellada: what I'm asking is more like: how is it reconciled that the PDF for $k = 1$ is so high when approaching 0, with the fact that CDF is (and must be) bounded at $1$. It would appear that integrating the PDF would yield something way higher than $1$. Commented Jul 12, 2016 at 20:17
• It sounds like you need to read stats.stackexchange.com/questions/4220/….
– whuber
Commented Jul 12, 2016 at 20:34
• Your feeling that the area under the pdf would be larger than 1 because of the way it increases as it approaches the origin is not uncommon (considering a plot of the density for $0<x<0.1$ say), but it's a mistaken impression. Note that as $x\to 0$ the density gets very close to $\frac{c}{\sqrt{x}}$ (while always below it for the right choice of $c$). Yet most people would look at the inverse of that upper bound (plot $\frac{c^2}{y^2}$ vs $y$ for $y>1.2$ say) -- without being worried about it exploding in area (and for good reason -- it doesn't). Perceptions can be fooled by a simple axis flip Commented Jul 13, 2016 at 0:02

The pdf of a $\chi^2$ distribution is $f(x;k)=\frac{1}{2^{\frac{k}{2}}\Gamma(k/2)}x^{k/2-1}\exp(-x/2).$

So we just need to evaluate the expression for $f(0;k)$.

$$f(0;1)=\infty$$ $$f(0;2)=0.5$$ $$f(0;3)=0$$ And so on. The R code for this is dchisq(0,k) for some positive k. It's really only interesting for $k= 2$ because $f(0;k)$ is infinite for $0<k<2$ and 0 for $k>2$.

• Many thanks for suggesting R, I'll try to plot the function to get a better feel. Commented Jul 12, 2016 at 20:24
• One could argue that it's not especially interesting at $x=0$ for any d.f. value other than 2, since it's always either going to infinity as $x\to 0$ (for $k<2$) or it's $0$ (for $k>2$). Commented Jul 13, 2016 at 0:05
• @Glen_b That's actually a really good point: the only interesting value of $f(0;k)$ is $2$ exactly.
– Sycorax
Commented Jul 13, 2016 at 0:45

Let's try to go back to the definition of this distribution and see what happens around 0.

By definition, the $\chi^2$ distribution is that of the sum of the squares of independent normal random variables:
$$Y = \sum_{i=1}^k Z_i^2 ,$$ (see the wikipedia page). We see easily that the value of the density is $0$ for $k\geq 3$ and $.5$ for $k=2$. For $k=1$, the case is a bit different.

Let's consider just that case to resolve your question: by a change of variable, we have $y=g(z)=z^2$ such that:

$$f_Y(y) = \left| \frac{d}{dy} (g^{-1}(y)) \right| \cdot f_Z(g^{-1}(y))\\ = \left| \frac{d}{dy} (\sqrt{y}) \right| \cdot f_Z(\sqrt{y})\\ = \frac{1}{2\sqrt{y}} \cdot \frac{1}{\sqrt{2}\pi} \exp(-y/2)$$

We understand a basic fact, the $\chi_1$ is not defined at $0$ because the squaring operation at that point is flat $g(0)=0$ and thus that $g^{-1}(0)$ is not defined (infinite).

• As the mathematics shows, the fact that the density is undefined at $0$ follows from two facts. It does not suffice that $g^\prime(0)=0$. In addition, you need that $f_Z(0) \ne 0$.
– whuber
Commented Jul 14, 2016 at 23:40