Unimodality (source code)

= Unimodality

= Unimodal
{synonym}

\b[Unimodality], in the single-maximum convention, means that a real-valued <function> rises toward one mode or plateau and then falls away. More precisely, for a function $f$ on an interval, there is a point $m$ such that $f$ is nondecreasing to the left of $m$ and nonincreasing to its right. These inequalities are weak: a flat top is allowed, and more than one point may achieve the maximum.

For an original example,
$$
f(x)=-\max(|x|-1,0)
$$
is zero throughout $[-1,1]$ and decreases as one moves outward beyond that plateau. It is unimodal despite lacking a unique maximizing point. In contrast, two separated peaks with a genuine dip between them violate the rise-then-fall requirement.

A useful characterization is that a unimodal function in this convention has interval-shaped <superlevel sets> $\{x:f(x)\geq c\}$. For a function attaining its maximum, the converse holds too: if all those sets are intervals, a decline followed by a later rise on the same side of a maximizer would create a disconnected superlevel set. In one dimension this is the <quasiconcave function> viewpoint. Boyd and Vandenberghe define quasiconcavity through convex superlevel sets.<Convex Optimization by Stephen Boyd and Lieven Vandenberghe>[§3.4.1, quasiconvex and quasiconcave functions]{ref}

The convention must be stated. In minimization, unimodal is also used for a function that first decreases and then increases; that corresponds to a <quasiconvex function> and interval-shaped sublevel sets. A single minimum and a single maximum are opposite shape conditions.

Unimodality also differs from <concavity>. The function $g(x)=e^{-x^2}$ has derivative $-2xe^{-x^2}$, so it rises up to zero and falls afterward. However,
$$
g''(x)=(4x^2-2)e^{-x^2}>0\qquad\text{when }|x|>1/\sqrt2,
$$
so it is not a <concave function> on the whole real line. Unimodality constrains the ordering of levels rather than the sign of curvature everywhere.

For a probability density, this shape defines one common meaning of a <unimodal distribution>. Adding symmetry around zero strengthens the conclusion: the <centred interval maximizes mass for an even unimodal density> lemma shows why a fixed-width observation window collects most probability when centered on the mode.