Visually, the pain index is the area of the region that is enclosed by
the horizontal line at zero percent and the drawdown line in the
Drawdown chart.
$$Pain index = \sum^{n}_{i=1} \frac{\mid D'_i \mid}{n}$$
where \(n\) is the number of observations of the entire series, \(D'_i\) is
the drawdown since previous peak in period i