# Mode of the $\chi^2$ distribution

I've been studying a statistics textbook that makes a claim that the $\chi^2$ distribution with $k$ degrees of freedom has a mode at $k - 2$ without proof. (Wikipedia seems to agree) Why is this? Is there a geometric, or even algebraic way, to understand this statement?

• Look at the wikipedia page for mode. The mode occurs at the highest peak of a continuous distribution which can be found using calculus. – Zachary Blumenfeld May 3 '16 at 0:44
• True. That doesn't seem very intuitive, though. (I'll be honest, taking a derivative of the gamma function is pretty nasty; I can't say I can do it. Thank goodness Wolfram Alpha can.) – ZachTheRiah May 3 '16 at 1:01
• You don't need to take the derivate of the Gamma function, since it is not a function of $x$. – Greenparker May 3 '16 at 1:03
• Good point; $k$ is a parameter. – ZachTheRiah May 3 '16 at 1:06

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

We need to find $x^*$ such that $x^* = \arg \max_\limits{x > 0} f(x)$. Then $x^*$ is the mode. Note that $\arg \max_\limits{x > 0} f(x) = \arg \max_\limits{x > 0} \log f(x)$, so we will find the mode by maximizing the log of the pdf instead of maximizing the pdf (this turns out to be easier).

\begin{align*} \log f(x) &= -\dfrac{k}{2} \log 2 - \log \Gamma(k/2) + \left(\dfrac{k}{2} - 1 \right) \log x - \dfrac{x}{2}\\ \dfrac{\log f(x)}{dx} &= \left(\dfrac{k}{2} - 1 \right) \dfrac{1}{x} - \dfrac{1}{2} \overset{set}{=} 0\\ \Rightarrow x^* &= k-2 \end{align*}

Thus we get that the mode is $x^* = k-2$. If $k \leq 2$, then the mode is $0$, since the $\chi^2$ pdf in that case is decreasing on the positives.

EDIT: To verify that the second derivate is negative, look at @MatthewGunn's comment below.

• Elaborating a bit, the 2nd derivative of $\log f$ is $-\left(\frac{k}{2} - 1 \right) x^{-2}$ hence, the pdf is log-concave everywhere iff $k \geq 2$. Thus the first order condition $x^* = k - 2$ achieves a maximum when $k \geq 2$. – Matthew Gunn May 3 '16 at 1:28
• +1 Thank you for this. I couldn't find it on multiple online searches. – Antoni Parellada May 3 '16 at 5:26
• +1. Plus, we can of course disregard the $2^{-k/2}\Gamma(k/2)^{-1}$ multiplicative constant from the very start (although it also drops out in the differentiation). – Stephan Kolassa May 3 '16 at 6:30
• I can't disagree that you're right. I guess I should have phrased it as a question about intuition, rather than a geometry/algebra argument. I'll accept this answer though since it answers the question. :) – ZachTheRiah May 4 '16 at 1:06

The solution by Greenparker is correct and the double derivative can be proved to be less than 0. Substitute x=k-2 -> k=x+2 in the 2nd derivative solution obtained (i.e. -(((x+2)/2)-1)*x^-2)

Thus we get, (-x/2)*(x^-2) which is negative. hence double derivative is negative.