Performance Metrics

Sharpe Ratio Style Metrics

Ratios that quantify the risk return trade off, with different risk and return measures.

PerformanceAnalytics.sharperatioFunction
sharperatio(R::Number,σ::Number,Rf::Number=0.;scale=1)

Calculates the Sharpe Ratio from a given return, standard deviation, and risk free rate.

\[SR=\frac{r_a - r_f}{\sigma_a}\]

source
sharperatio(R::AbstractArray{<:Number},Rf::Number=0.;scale)

Calculates the Sharpe Ratio from a given return series and a risk free rate.

source
sharperatio(R::AssetReturn,Rf::Number=0.)

Calculates the annualized Sharpe Ratio.

source
PerformanceAnalytics.adjustedsharpeFunction
adjustedsharpe(R::Number,σ::Number,S::Number,K::Number,Rf::Number=0.)

Calculates the Adjusted Sharpe Ratio from Pezier and White (2006) for a preestimated return, standard deviation, skewness, and kurtosis. It adjusts for skewness and kurtosis.

\[AdjSR=SR * [1+\frac{2}{6}*SR - (\frac{K-3}{24})*SR^2]\]

source
AdjustedSharp(R::AbstractArray{<:Number},Rf::Number=0.;method::AbstractString="population")

Calculates the Adjusted Sharpe Ratio from Pezier and White (2006) for a return series.

method: specifies the method to be used in the estimation of the Skewness and Kurtosis. Can be one of sample, population, or fisher. Defaults to "population"

source
AdjustedSharp(R::AbstractArray{<:Number},Rf::Number=0.;method::AbstractString="population")

Calculates the annualized Adjusted Sharpe Ratio from Pezier and White (2006) for a AssetReturn.

method: specifies the method to be used in the estimation of the Skewness and Kurtosis. Can be one of sample, population, or fisher. Defaults to "population"

source
PerformanceAnalytics.treynorratioFunction
treynorratio(Ra::AbstractArray{<:Number},Rb::AbstractArray{<:Number},Rf::Number=0;modified::Bool=false,scale=1)

Scale argument used to annualize all numbers for daily data use 252 (default is 1), for monthly 12, etc.

SharpeRatio that uses beta as risk rather than the assets standard deviation of returns. The modified TreynorRatio uses the systematic risk rather than the beta.

\[TreynorRatio = \frac{\frac{1}{n}\times\sum_{t=1}^n (r_{a,t}-r_{f,t})}{\beta_{r_a,r_b}}\]

\[ModifiedTreynorRatio = \frac{\frac{1}{n}\times\sum_{t=1}^n (r_{a,t}-r_{f,t})}{\beta_{r_a,r_b}\times std(R_b)}\]

source
treynorratio(Ra::AssetReturn,Rb::AssetReturn,Rf::Number=0;modified::Bool=false)

Calculates the Treynor Ratio.

source
PerformanceAnalytics.kappaFunction
kappa(R::AbstractArray{<:Number},MAR::Number=0.,k::Number=2)

If k=1 this returns the Sharpe-Omega Ratio. If k=2 this returns the Sortino Ratio

\[Kappa = \frac{r-MAR}{\sqrt[k]{\frac{1}{n}*\sum_{t=1}^nmax(MAR - r_t,0)^k}}\]

source
kappa(R::AssetReturn,MAR::Number=0.;k::Number=2)

If k=1 this returns the Sharpe-Omega Ratio. If k=2 this returns the Sortino Ratio

source
PerformanceAnalytics.appraisalratioFunction
appraisalratio(Ra::AbstractArray{<:Number},Rb::AbstractArray{<:Number},Rf::Number=0,method::AbstractString = "appraisal",scale::Number=1)

Jensen's Alpha adjusted for risk. The modified version uses β as the risk measure. The appraisal version uses specific risk. The alternative version uses systematic risk.

\[\frac{\alpha}{risk measure}\]

source
appraisalratio(Ra::AssetReturn,Rb::AssetReturn,Rf::Number=0;method::AbstractString = "appraisal")

Jensen's Alpha adjusted for risk.

source
PerformanceAnalytics.informationratioFunction
informationratio(Ra::AbstractArray{<:Number},Rb::AbstractArray{<:Number},scale::Number=1)

Calculates the Information Ratio. It is defined as the Active Premium over the Tracking Error. The tracking error needs to be annualized therefore it is important to specify the periodecity of the data with scale.

\[InformationRatio(Ra,Rb,scale) = \frac{ActivePremium(r_a,r_b,scale)}{TrackingError(r_a,r_b,scale)} = \frac{(1+\overline{r_a})^{scale}- (1+\overline{r_b})^{scale}}{\sqrt{\sum_{t=1}^n\frac{(r_{a,t} -r_{b,t})^2}{n\times\sqrt{scale}}}}\]

source
informationratio(Ra::AssetReturn,Rb::AssetReturn)

Calculates the Information Ratio. It is defined as the Active Premium over the Tracking Error.

source

Drawdown Based Metrics

PerformanceAnalytics.burkeratioFunction
burkeratio(Ra::AbstractArray{<:Number}, Drawdowns::AbstractArray{<:Number};Rf::Number=0.,scale=1)

Calculates the Burke Ratio from a return series, a risk free rate, and drawdowns.

\[BurkeRatio = \frac{r_a-r_f}{\sqrt{\sum_{t=1}^{d}D_t^2}}\]

source
burkeratio(R::AbstractArray{<:Number}; Rf::Float64 = 0., modified::Bool = false, scale::Number=1)

Calculates the Burke Ratio from a return series and a risk free rate.

Arguments

  • Ra is a vector of returns.
  • Rf is a risk free rate
  • modified adjusted for the number of drawdowns (default is false)
  • scale to annualize (default to 1)
source
burkeratio(AR::AssetReturn; Rf::Float64 = 0., modified::Bool = false)

Calculates the Burke Ratio from a return series and a risk free rate.

Arguments

  • Ra is a vector of returns.
  • Rf is the risk free rate.
  • modified adjusted for the number of drawdowns (default is false)
source
PerformanceAnalytics.calmarratioFunction
calmarratio(R::AbstractArray{<:Number},scale::Float64=1.)

Risk return metric. Gives the annualized return divided by the maximum drawdown. scale is the scaling factor used to annualize returns (defaults tol 1.)

\[CalmarRatio = \frac{r_a}{maxDD}\]

source
calmarratio(R::AssetReturn)

Risk return metric. Gives the annualized return divided by the maximum drawdown.

source

Misc

PerformanceAnalytics.jensensalphaFunction
jensensalpha(Y::AbstractArray{<:Number},X::AbstractArray{<:Number}...;scale::Number=1)

Returns the annualized Jensens Alpha.

Arguments

  • Y the assets return
  • X the benchmark return
  • scale the scaling number used to annualize returns (defaults to 1)
source
jensensalpha(Y::AssetReturn,X::AssetReturn...)

Returns the annualized Jensens Alpha.

source
PerformanceAnalytics.bernardoledoitratioFunction
bernardoledoitratio(R::AbstractVector{<:Number})

Calculates the Bernardo Ledoit ratio for a return series.

\[Bernardo Ledoit Ratio = \frac{\frac{1}{n}\sum_{t=1}^{n}max(r_t,0)}{\frac{1}{n}\sum_{t=1}^{n}max(-r_t,0)}\]

source
bernardoledoitratio(R::AssetReturn)

Calculates the Bernardo Ledoit ratio for a AssetReturn.

source
PerformanceAnalytics.hurstindexFunction
hurstindex(R::AbstractArray{<:Number})

Measures whether returns are random, peristent, or mean reverting.

  • 0 to 0.5: mean reverting
  • 0.5: random
  • 0.5 to 1: persistent

\[HurstIndex = \frac{log(\frac{[max(r) - min(r)]}{\sigma})}{log(n)}\]

source
hurstindex(R::AssetReturn)

Measures whether returns are random, peristent, or mean reverting.

source