skfolio.measures.probabilistic_sharpe_ratio#

skfolio.measures.probabilistic_sharpe_ratio(returns, benchmark_sharpe_ratio=0.0, risk_free_rate=0.0)[source]#

Compute the Probabilistic Sharpe Ratio (PSR).

The PSR estimates the probability that the true Sharpe ratio of a return series exceeds a benchmark, given the length of the series and the non-normality of its returns:

\[PSR(SR^*) = Z\left[\frac{\left(\hat{SR} - SR^*\right)\sqrt{T - 1}} {\sqrt{1 - \gamma_3 \hat{SR} + \frac{\gamma_4 - 1}{4} \hat{SR}^2}}\right]\]

with \(\hat{SR}\) the observed Sharpe ratio, \(SR^*\) the benchmark, \(T\) the number of observations, \(\gamma_3\) the skew, \(\gamma_4\) the kurtosis and \(Z\) the standard normal CDF.

Parameters:
returnsndarray of shape (n_observations,) or (n_observations, n_assets)

Array of return values.

benchmark_sharpe_ratiofloat, default=0.0

Benchmark Sharpe ratio \(SR^*\).

risk_free_ratefloat, default=0.0

Risk-free rate used to compute the excess mean of returns.

Returns:
valuefloat or ndarray of shape (n_assets,)

Estimated probability that the true Sharpe ratio exceeds benchmark_sharpe_ratio. If returns is a 1D-array, the result is a float. If returns is a 2D-array, the result is a ndarray of shape (n_assets,).

Notes

All quantities are per-period: returns, risk_free_rate and benchmark_sharpe_ratio must share the same frequency, and none of them is annualized.

NaN handling: NaNs are ignored. A series with fewer than three observations, with no dispersion, or with a non-positive variance adjustment yields NaN.

References

[1]

“The Sharpe Ratio Efficient Frontier”. Bailey, D. and Lopez de Prado, M. (2012)