# If $f(x)$ is a unimodal probability density function, how can I show that its mode is at $f'(x)=0$?

If the function $f(x)$ is continuous and a probability density function (PDF), how can I show that its mode is at $f'(x)=0$?

• As per Christoph's answer, this does not hold. Not even if $f$ is everywhere differentiable (it could have a vanishing derivative at a minimum at the extremes of its domain of definition). Commented Oct 8, 2015 at 11:53
• @Stephan The logic of the question is a little different. It does not ask to show that all points of vanishing derivative are modes, but only that the derivative at a mode must vanish. (The only way that can fail to be true is when $f$ is not differentiable at its mode.)
– whuber
Commented Oct 8, 2015 at 15:01
• you might read it either way, I guess: show that its mode is at $f'(x)=0$ seems compatible with the aim to show the (false, as we discussed) implication $f'(x)=0\Rightarrow\text{a mode}$ Commented Oct 8, 2015 at 16:08

If it's only continuous but not differentiable at the mode, you can't. Consider the Laplace distribution.

• Also see en.wikipedia.org/wiki/Uniform_distribution_(continuous)#/media/…, the density for the continuous uniform distribution on [a, b]. There are points outside [a, b] where df/dx = 0. Commented Oct 8, 2015 at 12:23
• Same comment as above, but better example: en.wikipedia.org/wiki/Triangular_distribution#/media/…, the triangular distribution (can be generated as the sum of two iid uniforms). Commented Oct 8, 2015 at 12:40
Find the maximum value. The Laplace distribution is defined piece-wise, and not smooth at the mode, which is at the piece-wise common point (A.K.A., corner point), and such a common, junctional corner point in a piece-wise defined function has no general continuity guarantee of either the separate piecewise defined functions' amplitudes nor any of their derivatives. The mode for a Laplace distribution occurs at $\frac{e^{-\frac{x-\mu }{\beta }}}{2 \beta }=\frac{e^{-\frac{\mu -x}{\beta }}}{2 \beta }\to x=\mu$, because $f(x=\mu)=\frac{1}{2 \beta }$ is the maximum value of $f$. Of course there are continuous functions that are differentiable nowhere, and differentiability is not a requirement. Thus, the general answer is simply find the maximum of the pdf. This can be done in closed form as above for something as simple as the Laplace distribution. It can be done numerically for nice smooth functions using derivatives example by referring to How to prevent newton's method from finding maxima? and altering it to avoid minima. Or, more generally for nasty functions using a canned routine like FindMaximum in Mathematica with a global search routine like RandomSearch.
• @Carl If you define the Laplace distribution piecewise for the negative and positive reals, then sure, the mode 0 is at a boundary of each sub-part. But in the standard way of thinking about it, the Laplace density is just a function $\frac12 \exp(- \lvert x \rvert )$ defined on $\mathbb R$, and $0$ is in no way a boundary point of $\mathbb R$. Commented Mar 26, 2017 at 16:45
• @Carl In this case we're talking about a boundary point of the domain of the variable. The random variable is defined over the whole real line, so for the Laplace, the set $A$ in the definition you quote is $\mathbb{R}$. Commented Mar 26, 2017 at 17:11