According to definition the ulcer index is calculated as the root square of the mean of squared drawdowns.
However in the code the calculation being done is different. The squared drawdowns are being summed and square root is being performed and only then it is being divided by the count.
According to definition the ulcer index is calculated as the root square of the mean of squared drawdowns. However in the code the calculation being done is different. The squared drawdowns are being summed and square root is being performed and only then it is being divided by the count.
return np.divide(np.sqrt(np.sum(np.power(dd, 2))), dd.count())
https://github.com/pmorissette/ffn/blob/16aefe6cf05227b135583f16cfdd757407b50205/ffn/core.py#L2425