qis.compute_ra_perf_table

qis.compute_ra_perf_table(prices, perf_params=None)[source]

Compute the full risk-adjusted performance table.

Combines outputs from compute_performance_table (return metrics) and compute_risk_table (volatility, drawdowns, higher moments) and derives the standard ratio family: Sharpe (rf=0, excess, log-annualised, log-excess, arithmetic, arithmetic-excess), Sortino, Calmar.

Parameters:
  • prices (DataFrame | Series) – DataFrame or Series of asset price levels.

  • perf_params (PerfParams) – Performance parameter object. If None, the frequency is inferred from the index: PerfParams(freq=pd.infer_freq(prices.index)). A regular business-day index then gives freq_vol, freq_reg and freq_excess_return of ‘B’ (volatility annualised with 252), while freq_drawdown stays ‘D’ and freq_skewness ‘ME’; an irregular index, for which pd.infer_freq returns None, gives the PerfParams() defaults. Pass an explicit PerfParams for reproducible grids.

Returns:

DataFrame indexed by asset with all performance and risk columns merged. Overlapping columns (e.g. START_DATE, END_DATE) are present once, taken from the performance table. Visible return columns retain each asset’s native observed endpoints. The p.a., log, excess, and Sortino ratio numerators instead use complete freq_vol boundaries within each asset’s observed support, so they describe the same sample as their volatility denominators without extending terminated histories. The Calmar numerator is the native-endpoint PA_EXCESS_RETURN, because its denominator MAX_DD is measured on freq_drawdown up to each asset’s final observation. Undefined ratios are missing rather than infinite: SORTINO_RATIO with fewer than two negative freq_vol returns and CALMAR_RATIO for a history that is never under water.

Return type:

DataFrame