# Relationship Between "Statistical Mode" and "Derivatives"

In elementary school, we were usually given the following type of problem. For example:

• Consider the numbers 1, 6, 6, 12, 16, 19, 22, 51, 60
• Find the Mean, Median and Mode of these numbers

Finding the "Mode" in such problems is generally easy - but I always wondered how we can take the "Mode" of a Probability Distribution Function. For example, suppose we are not provided with a sample of numbers and instead we are only given the Probability Distribution Function for a Normal Distribution, what is the mode?

I tried to use the following logic:

• We know that the "Mean" of a Probability Distribution Function can be calculated using the Expected Value of this Probability Distribution
• Since we know that the "Mode" is the most common value (i.e. maximum) - could the "Mode" of a Probability Distribution Function be calculated by taking the derivative of the Probability Distribution Function, setting this to 0 and then solving this equation?

Is this logic correct? Could someone please comment on how the "Mode" can be calculated of a Probability Distribution Function? And could the "Median" be calculated in a similar way?

Thanks

## Finding the mode

I'm going to assume that you are dealing with a continuous and univariate (only one variable) distribution. You would find the mode by how you would typically find the absolute extrema of a function on some interval.

Let $$f(x)$$ be the probability density function. In order to find the mode, first find all values that satisfy

$$\frac{d}{dx}f(x)=0$$

if there are such values. Note that there could be more than one value that makes the derivative equal to zero, which may be the case if you are dealing with a multimodal distribution. These values are your "candidates" for the mode of the distribution.

Additionally, you have to consider the values when $$\frac{d}{dx}f(x)$$ is undefined. These are candidates for the mode as well.

Finally, you also have to consider the endpoints of the distribution, as these could also be candidates for the mode.

The candidate that maximizes $$f(x)$$ is the mode of the distribution.

Usually, the mode is when the derivative equals $$0$$. Some examples where this is true is the Normal distribution and the Gumbel distribution. Of course, there are exceptions, which I will mention below.

Sometimes, the derivative will never be $$0$$. A good example is the Exponential distribution, where the mode is always $$0$$, or the Pareto distribution, where the mode is the scale parameter.

Sometimes, there will be a value where the derivative is $$0$$, but the mode occurs at the endpoints. An example is the Beta distribution with parameters $$\alpha=0.5$$, $$\beta=0.5$$. This is a special example where there are two modes, which are at the endpoints $$0$$ and $$1$$.

Sometimes, the mode can be any value in a range. For example, the mode of the continuous uniform distribution is any value in $$[a, b]$$.

Finally, sometimes the derivative will never be zero, and the endpoints will also not give the mode. You would then find when $$f'(x)$$ is undefined. An example of such a distribution is the Laplace distribution or the Triangular distribution.

## Finding the median

Finding the median is a more complicated process. Let $$f(x)$$ be the probability density function. Then, the median is the value $$M$$ where

$$\int_{-\infty}^{M}{f(x)dx} = 0.5.$$

In other words, you have to find when the cumulative distribution function equals $$0.5$$. This involves taking the integral of the probability density function, instead of taking the derivative.

Sometimes the integral can be done, but you may run into cases where the antiderivative is not an elementary function, and finding the median becomes much harder. For example, there's no simple closed form for the median of a Gamma distribution.

If your distribution is symmetrical though, then the median is the mean, and if the distribution is also unimodal, then the median is both the mean and the mode. In that case, you don't have to use the cumulative distribution function.

• @ Efficiency: thank you for your very informative answer! Are you familiar with regression models in statistics? I have some questions about them... could I post the links for you to check out if you have time? Nov 2, 2022 at 4:09
• I'm not really familiar with regression models, sorry :P Nov 4, 2022 at 0:33