qis.plots.derived.regime_premium.plot_regime_sharpe_decomposition

qis.plots.derived.regime_premium.plot_regime_sharpe_decomposition(table, regime_ids=None, null_column=None, total_column='sharpe', regime_colors=None, var_format='{:.2f}', min_label_width=0.12, row_separators=None, xlabel='Sharpe ratio contribution (annualised)', legend_loc='lower right', title=None, fontsize=10, figsize=(11.0, 6.2), ax=None)[source]

Horizontal stacked regime contributions per row, with the total and the tail null.

Parameters:
  • table (DataFrame) – a premium table, one row per asset, as compute_regime_premium_table returns; rows are drawn top to bottom in table order

  • regime_ids (Sequence[str] | None) – regimes to stack, in order; None reads Bear, Normal, Bull or Q1 to Qn off the <id>_sharpe columns

  • null_column (str | None) – column of the null marked by a diamond; None uses null_<first id>_sharpe when present and draws no diamond otherwise

  • total_column (str) – column of the total Sharpe ratio, marked by a tick

  • regime_colors (Dict[str, str] | None) – colour per regime id; None uses the classifier’s colours

  • var_format (str) – format of the segment labels

  • min_label_width (float) – narrowest segment that carries its value

  • row_separators (Sequence[int] | None) – positions after which a horizontal rule separates groups of rows

  • xlabel (str) – x-axis label

  • legend_loc (str | None) – legend location; None hides the legend

  • title (str | None) – axis title

  • fontsize (int) – font size of the labels and legend

  • figsize (Tuple[float, float]) – size of a new figure

  • ax (Axes | None) – axis to draw on; None creates a figure

Returns:

the new figure, or None when ax is given

Raises:

ValueError – if the table has no regime contribution columns

Return type:

Figure | None