qis.PerfParams

class qis.PerfParams(freq=None, freq_vol='ME', freq_skewness='ME', freq_drawdown='D', freq_reg='QE', freq_excess_return='ME', return_type=ReturnTypes.LOG, sharpe_convention=SharpeConvention.PA, rates_data=None)[source]

Bases: object

sampling frequencies and conventions for risk-adjusted performance statistics.

Every statistic is frequency-relative: volatility computed on monthly returns is not the same number as volatility computed on daily returns, and the ratio is not a rescaling. The frequencies are therefore explicit here rather than assumed, and each factsheet panel states the frequency it was computed at. See qis/docs/reporting_frequencies.md.

Passing freq sets freq_vol, freq_reg and freq_excess_return to the same value. It sets freq_drawdown only when that field is passed as None: the default freq_drawdown='D' is kept, so PerfParams(freq='ME') still measures drawdowns on calendar days. freq_skewness is never set by freq. The per-statistic fields are for the cases where one statistic needs a different grid from the rest.

Variables:
  • freq (str) – single frequency applied to the fields listed above; None keeps them independent and defaults freq itself to ‘ME’

  • freq_vol (str) – sampling for volatility, and therefore the Sharpe denominator; also the grid of the ratio numerators and of NUM_OBS

  • freq_skewness (str) – sampling for skewness and kurtosis

  • freq_drawdown (str) – sampling for drawdowns and for the WORST and BEST returns; ‘D’ keeps the peak-to-trough path at native resolution rather than on the reporting grid. A coarser grid keeps each asset’s final observation, so CURRENT_DD is the drawdown at the last observation

  • freq_reg (str) – sampling for linear and quadratic regressions against a benchmark

  • freq_excess_return (str) – stored, printed and copied for compatibility but not read by any calculation; excess returns are formed on the grid of the statistic that uses them

  • return_type (qis.perfstats.config.ReturnTypes) – log or arithmetic returns for the volatility computation

  • sharpe_convention (qis.perfstats.config.SharpeConvention) – which Sharpe object the regime-conditional Sharpe contributions report — compound p.a., arithmetic, or log. PA is the default and leaves every existing output unchanged; the table’s Sharpe columns do not depend on it. See qis/docs/sharpe_conventions.md

  • rates_data (pandas.Series | None) – risk-free rate series deducted by the excess-return columns (PA_EXCESS_RETURN, SHARPE_EXCESS, SORTINO_RATIO, CALMAR_RATIO and the other excess members) and by benchmark regressions. Without it every excess column equals its zero-rate counterpart; it is not an error to omit it

Parameters:
__init__(freq=None, freq_vol='ME', freq_skewness='ME', freq_drawdown='D', freq_reg='QE', freq_excess_return='ME', return_type=ReturnTypes.LOG, sharpe_convention=SharpeConvention.PA, rates_data=None)
Parameters:
Return type:

None

Methods

__init__([freq, freq_vol, freq_skewness, ...])

copy([freq_reg, freq_vol, freq_drawdown, ...])

a copy with the given fields replaced and every other field kept.

print()

Attributes

freq: str = None
freq_vol: str = 'ME'
freq_skewness: str = 'ME'
freq_drawdown: str = 'D'
freq_reg: str = 'QE'
freq_excess_return: str = 'ME'
return_type: ReturnTypes = 'Log'
sharpe_convention: SharpeConvention = 1
rates_data: Series | None = None
print()[source]
copy(freq_reg=None, freq_vol=None, freq_drawdown=None, freq_excess_return=None, return_type=None, rates_data=None, sharpe_convention=None, freq_skewness=None, **kwargs)[source]

a copy with the given fields replaced and every other field kept.

freq is carried over as stored; it is not re-applied, so the copy keeps the per- statistic frequencies of this object or the ones passed here.

Parameters:
  • freq_reg (str) – replacement freq_reg; None keeps the current value

  • freq_vol (str) – replacement freq_vol; None keeps the current value

  • freq_drawdown (str) – replacement freq_drawdown; None keeps the current value

  • freq_excess_return (str) – replacement freq_excess_return; None keeps the current value

  • return_type (ReturnTypes) – replacement return_type; None keeps the current value

  • rates_data (Series) – replacement rates_data; None keeps the current series

  • sharpe_convention (SharpeConvention) – replacement sharpe_convention; None keeps the current value

  • freq_skewness (str) – replacement freq_skewness; None keeps the current value

  • **kwargs – ignored, for compatibility with callers passing report settings

Returns:

a new PerfParams

Return type:

PerfParams