Quant Memo
Advanced

Multimodality and the Dip Test

Some datasets aren't clustered around one typical value but around two or more — a return distribution mixing calm and crisis regimes, for instance — and the dip test is a formal way to check whether apparent multiple peaks in the data are real or just sampling noise.

Prerequisites: Kernel Density Estimation

A histogram of daily returns during a period spanning both a calm bull market and a sharp crash might show two separate bumps — a tight cluster of small positive returns and a wider, shifted cluster of large negative ones — rather than one smooth bell shape. That's multimodality: the data behaves as if drawn from more than one underlying regime rather than a single stable process, which matters enormously for risk modeling, since fitting a single normal distribution to genuinely bimodal data will understate tail risk in one regime and overstate it in the other.

The trouble is that random noise alone can make a perfectly unimodal (single-peaked) distribution's histogram look lumpy in a small sample, so eyeballing a chart isn't reliable evidence of real multimodality. Hartigan's dip test formalizes the check: it measures the maximum discrepancy between the data's empirical distribution function and the best-fitting unimodal distribution, producing a "dip statistic," and compares that statistic to what would be expected from genuinely unimodal data of the same sample size, yielding a p-value. A small p-value is evidence the apparent lumpiness isn't just noise.

For instance, applying the dip test to a return series with a visually obvious double hump might return a p-value of 0.01, supporting the case that the data really does come from (at least) two distinct regimes — whereas the same test on a noisy but genuinely single-peaked sample would typically return a p-value well above the usual 0.05 cutoff, correctly failing to reject unimodality.

The dip test measures how far a dataset's distribution departs from the best-fitting single-peaked (unimodal) shape and converts that gap into a p-value, giving a formal way to distinguish genuine multimodality — such as a return series mixing calm and crisis regimes — from a lumpy-looking histogram that's really just sampling noise.

Related concepts

Practice in interviews

Further reading

  • Hartigan and Hartigan, The Dip Test of Unimodality, Annals of Statistics
ShareTwitterLinkedIn