Skip to content

Commit

Permalink
Fixed sigma_sr in probabilistic_ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
ranaroussi authored Jun 12, 2022
1 parent bfc2470 commit 9493ed8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions quantstats/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,9 @@ def probabilistic_ratio(series, rf=0., base="sharpe", periods=252, annualize=Fal

n = len(series)

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

ratio = (base - rf) / sigma_sr
psr = _norm.cdf(ratio)

Expand Down

0 comments on commit 9493ed8

Please sign in to comment.