Skip to content

Implement Probabilistic Sharpe Ratio (PSR) #43

@miron

Description

@miron

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 psr

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions