ranaroussi / quantstats

Portfolio analytics for quants, written in Python
Apache License 2.0
4.76k stars 835 forks source link

fix : calculation formula mistake on `stats.probabilistic_ratio` #195

Closed Gabrielvon closed 2 years ago

Gabrielvon commented 2 years ago

refer to this repos and the paper menthioed, the formula for estimate SR is different.

https://github.com/rubenbriones/Probabilistic-Sharpe-Ratio/blob/7c65ea513df575a93a3a474b6e3c2a0a9e724607/src/sharpe_ratio_stats.py#L47

ranaroussi commented 2 years ago

Hi.

Rejecting this as the correct formula is:

sigma_sr = np.sqrt((1 + (0.5 * sharpe ** 2) - (skew_no * sharpe) + (((kurtosis_no - 3) / 4) * sharpe ** 2)) / (n - 1))