-
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or request
Description
For annual probabilistic sharpe ratio, a dataframe sample of yearly returns (yearly log returns) over at least 2 years is needed:
Algo().assets_close().resample('Y')
Consider daily/weekly/monthly returns.
pct_change() returns to log returns:
np.log1p(df['Yearly Returns']
@staticmethod
def psr(df, benchmark=0):
sharpe = stats['Sharpe']
skew = scipy.stats.skew(df['Yearly Returns'])
kurtosis = scipy.stats.kurtosis(df['Yearly Returns'])
n = len(df)
sigma_sr = np.sqrt(
(1/(n-1)) * (1 + 0.5*sharpe**2 - skew*sharpe+(kurtosis/4)*sharpe**2))
ratio = (sharpe - benchmark) / sigma_sr
psr = scipy.stats.norm.cdf(ratio)
return psrMetadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request