Metrics Reference

This page provides a visual overview of all available metrics organized by category, along with detailed reference tables.

Metric Categories

The diagram below shows the complete set of portfolio metrics organized by category:

flowchart LR subgraph Returns["Return Calculations"] SAR[SimpleAssetReturn] LAR[LogAssetReturn] CR[CumulativeReturn] AR[AnnualizedReturn] AMR[ArithmeticMeanReturn] GMR[GeometricMeanReturn] end subgraph Volatility["Volatility Metrics"] STD[StdDev] DD[DownsideDeviation] UD[UpsideDeviation] AV[AnnualVolatility] end subgraph Drawdown["Drawdown Analysis"] DDS[DrawDowns] ADD[ArithmeticDrawDowns] MDD[MaxDrawDown] MADD[MaxArithmeticDrawDown] UI[UlcerIndex] PI[PainIndex] end subgraph RiskAdjusted["Risk-Adjusted Returns"] SH[Sharpe] SO[Sortino] CAL[Calmar] OM[Omega] STR[SterlingRatio] BRK[BurkeRatio] PRR[PainRatio] UPR[UpsidePotentialRatio] end subgraph CAPMMetrics["CAPM Metrics"] BETA[Beta] ER[ExpectedReturn] TR[Treynor] JA[JensenAlpha] end subgraph Relative["Relative Performance"] TE[TrackingError] IR[InformationRatio] M2M[M2] MSE[MSquaredExcess] AP[ActivePremium] end subgraph Capture["Market Capture"] UC[UpCapture] DC[DownCapture] UDCR[UpDownCaptureRatio] end subgraph Risk["Risk Metrics"] VAR[VaR] ES[ExpectedShortfall] TLR[TailRatio] STB[Stability] end subgraph Moments["Statistical Moments"] ARM[AssetReturnMoments] end subgraph RollingWindow["Rolling Framework"] ROL[Rolling] end

API Reference Tables

Return Calculations

TypeInputOutputDescription
SimpleAssetReturn{T}Prices(Pt - Pt-k) / Pt-kArithmetic returns
LogAssetReturn{T}Pricesln(Pt / Pt-k)Log returns
CumulativeReturn{T}Returnsprod(1 + Ri)Geometric cumulative
AnnualizedReturn{T}ReturnsCAGRAnnualized return
ArithmeticMeanReturn{T}Returnssum(Ri) / nSimple average
GeometricMeanReturn{T}Returns(prod(1+Ri))^(1/n) - 1Geometric mean

Volatility Metrics

TypeInputOutputDescription
StdDev{T}ReturnssigmaStandard deviation
DownsideDeviation{T}Returnssigma_downSemi-deviation below threshold
UpsideDeviation{T}Returnssigma_upSemi-deviation above threshold
AnnualVolatility{T}Returnssigma * sqrt(period)Annualized volatility

Drawdown Analysis

TypeInputOutputDescription
DrawDowns{T}ReturnsCurrent DDGeometric drawdown
ArithmeticDrawDowns{T}ReturnsCurrent DDArithmetic drawdown
MaxDrawDown{T}ReturnsMin DDWorst geometric drawdown
MaxArithmeticDrawDown{T}ReturnsMin DDWorst arithmetic drawdown
UlcerIndex{T}ReturnsRMS(DD)Root-mean-square of drawdowns
PainIndex{T}ReturnsMean(|DD|)Mean absolute drawdown

Risk-Adjusted Ratios

TypeFormulaParameters
Sharpe{T}sqrt(T) * (E[R] - rf) / sigmaperiod=252, risk_free=0
Sortino{T}sqrt(T) * (E[R] - rf) / sigma_downperiod=252, risk_free=0
Calmar{T}AnnualizedReturn / abs(MaxDD)period=252
Omega{T}Probability ratio above thresholdthreshold=0
SterlingRatio{T}AnnualizedReturn / (abs(AvgDD) + 10%)period=252
BurkeRatio{T}AnnualizedReturn / sqrt(sum(DD²))period=252
PainRatio{T}AnnualizedReturn / PainIndexperiod=252
UpsidePotentialRatio{T}E[max(R-MAR,0)] / DownsideDeviationmar=0

CAPM Metrics

TypeFormulaInput
Beta{T}Cov(Ra, Rm) / Var(Rm)AssetBenchmarkReturn
ExpectedReturn{T}rf + beta(E[Rm] - rf)AssetBenchmarkReturn
Treynor{T}(E[R] - rf) / betaAssetBenchmarkReturn
JensenAlpha{T}E[R] - (rf + beta(E[Rm] - rf))AssetBenchmarkReturn

Relative Performance

TypeFormulaInput
TrackingError{T}sigma(Ra - Rb)AssetBenchmarkReturn
InformationRatio{T}E[Ra - Rb] / sigma(Ra - Rb)AssetBenchmarkReturn
M2{T}Rf + (Rp - Rf) * (σb / σp)AssetBenchmarkReturn
MSquaredExcess{T}M2 - E[Rb]AssetBenchmarkReturn
ActivePremium{T}AnnualizedReturn(port) - AnnualizedReturn(bench)AssetBenchmarkReturn

Market Capture Ratios

TypeFormulaInputInterpretation
UpCapture{T}Geometric mean ratio (up periods)AssetBenchmarkReturn>1 = outperforms in up markets
DownCapture{T}Geometric mean ratio (down periods)AssetBenchmarkReturn<1 = loses less in down markets
UpDownCaptureRatio{T}UpCapture / DownCaptureAssetBenchmarkReturn>1 = favorable asymmetry

Risk Metrics

TypeDescriptionParameters
VaR{T}Value at Risk at confidence levelalpha=0.05
ExpectedShortfall{T}Expected loss beyond VaRalpha=0.05
TailRatio{T}P95 / abs(P5)b=500 (histogram bins)
Stability{T}R² of cumulative log returns-

Statistical Moments

TypeOutputDescription
AssetReturnMoments{T}NamedTuple(mean, std, skewness, kurtosis)All four moments

Rolling Window Framework

TypeDescriptionParameters
Rolling{T,S}Wrap any OnlineStat for rolling windowstat, window
# Examples
Rolling(Sharpe{Float64}(), window=60)     # 60-period rolling Sharpe
Rolling(MaxDrawDown{Float64}(), window=30) # 30-period rolling max DD
Rolling(Calmar{Float64}(), window=252)     # 1-year rolling Calmar