qis.plots.derived.regime_premium.plot_regime_beta_profiles

qis.plots.derived.regime_premium.plot_regime_beta_profiles(betas, groups, se=None, regime_ids=('Bear', 'Normal', 'Bull'), group_colors=None, group_labels=None, markers=('o', '^', 'v', 's', 'D', 'P'), xlabel='Benchmark regime', ylabel='Regime beta on the benchmark', legend_loc='lower right', title=None, fontsize=10, figsize=(7.2, 4.4), ax=None)[source]

Group-mean regime betas with the members’ range, mean standard errors and total beta.

Parameters:
  • betas (DataFrame) – one row per asset with beta_<id> per regime and beta_total, as compute_regime_betas returns

  • groups (Series) – group of each asset, indexed like betas; groups are drawn in order of first appearance

  • se (DataFrame | None) – optional standard errors with beta_<id>_se columns, as compute_regime_betas_bootstrap returns; the error bars are the group mean

  • regime_ids (Sequence[str]) – regimes on the x axis, in order

  • group_colors (Dict[str, str] | None) – colour per group; None uses the matplotlib cycle

  • group_labels (Dict[str, str] | None) – legend label per group; None uses the group names

  • markers (Sequence[str]) – marker per group, in group order

  • xlabel (str | None) – x-axis label

  • ylabel (str) – y-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

Return type:

Figure | None