qis.StressReportConfig

class qis.StressReportConfig(title='Portfolio stress report', model_label='', factor_labels=<factory>, response_diagnostics=None, cluster_memberships=<factory>, cluster_linkages=<factory>, cluster_cutoffs=<factory>, selected_grids=(), notes=(), write_workbook=True, write_previews=False, model_name='Factor model', appendix_table=None, appendix_title='Coverage and estimation quality', appendix_subtitle='', appendix_notes=(), report_name=None, cluster_labels=<factory>, portfolio_r2=None, factor_beta_intervals=None, beta_interval_confidence=0.95, beta_interval_label='WLS-HAC benchmark', beta_interval_notes=(), beta_interval_target='benchmark', beta_interval_kind='confidence', beta_interval_display='overlay')[source]

Bases: object

Presentation options and caller-supplied estimation diagnostics.

Variables:
  • title (str) – Report heading and PDF title.

  • model_label (str) – Optional plain model/version label.

  • factor_labels (Mapping[str, str]) – Display aliases, keyed by actual factor ID.

  • response_diagnostics (pandas.DataFrame | None) – Optional response-indexed diagnostics, including r2.

  • portfolio_r2 (float | None) – Optional caller-computed portfolio prediction R-squared, replacing the legacy weighted instrument diagnostic. Negative values are valid.

  • cluster_memberships (Mapping[str, pandas.Series]) – Optional fitted group-to-response membership Series.

  • cluster_linkages (Mapping[str, numpy.ndarray]) – Matching fitted linkage arrays in membership index order.

  • cluster_cutoffs (Mapping[str, float]) – Matching fitted cutoffs; never estimated by the report.

  • cluster_labels (Mapping[str, str]) – Optional cadence-prefixed cluster-ID to descriptive label mapping.

  • selected_grids (tuple[str, ...]) – Up to six caller-named grids for the sensitivity page. Empty selects the ranked factor families or first six custom grids; all grids are always exported.

  • notes (tuple[str, ...]) – Plain methodology/coverage notes supplied by the application.

  • write_workbook (bool) – Write a numerical workbook using the existing QIS serializer.

  • write_previews (bool) – Also save PNG previews for inspection.

  • model_name (str) – Short model name used in slide and figure titles.

  • appendix_table (pandas.DataFrame | None) – Optional preformatted parser-owned table before the final notation guide.

  • appendix_title (str) – Parser-owned page title.

  • appendix_subtitle (str) – Parser-owned description above the table.

  • appendix_notes (tuple[str, ...]) – Parser-owned variable definitions and source explanations.

  • report_name (str | None) – Optional account/portfolio name on the first page; defaults to title. The header appends the actual notional, currency and assigned model label.

  • factor_beta_intervals (pandas.DataFrame | None) – Optional factor-indexed estimates and pointwise bounds in portfolio-return/native-factor units. Required columns are estimate, lower and upper; optional status describes weak or unavailable estimates. Estimates must be finite; lower/upper bounds may be negative/positive infinity. Unavailable rows have all three numerical entries missing. The caller owns estimation; target selects production or benchmark inference.

  • beta_interval_confidence (float) – Confidence level of the supplied intervals; default 95%.

  • beta_interval_label (str) – Name of the independent inference benchmark.

  • beta_interval_notes (tuple[str, ...]) – Caller-supplied inference conventions and limitations.

  • beta_interval_target (str) – ‘benchmark’ (default) or ‘production’. Production estimates must equal the reported betas; their dots sit at the bar endpoints.

  • beta_interval_kind (str) – ‘confidence’ (default) or ‘stability’. Stability ranges are explicitly labelled and make no nominal confidence-coverage claim.

  • beta_interval_display (str) – ‘overlay’ (default) adds chart whiskers and a diagnostic table; ‘table’ keeps clean exposure charts and the full diagnostic table. Neither setting changes supplied bounds or numerical exports.

Parameters:
__init__(title='Portfolio stress report', model_label='', factor_labels=<factory>, response_diagnostics=None, cluster_memberships=<factory>, cluster_linkages=<factory>, cluster_cutoffs=<factory>, selected_grids=(), notes=(), write_workbook=True, write_previews=False, model_name='Factor model', appendix_table=None, appendix_title='Coverage and estimation quality', appendix_subtitle='', appendix_notes=(), report_name=None, cluster_labels=<factory>, portfolio_r2=None, factor_beta_intervals=None, beta_interval_confidence=0.95, beta_interval_label='WLS-HAC benchmark', beta_interval_notes=(), beta_interval_target='benchmark', beta_interval_kind='confidence', beta_interval_display='overlay')
Parameters:
Return type:

None

Methods

__init__([title, model_label, ...])

Attributes

title: str = 'Portfolio stress report'
model_label: str = ''
factor_labels: Mapping[str, str]
response_diagnostics: DataFrame | None = None
cluster_memberships: Mapping[str, Series]
cluster_linkages: Mapping[str, ndarray]
cluster_cutoffs: Mapping[str, float]
selected_grids: tuple[str, ...] = ()
notes: tuple[str, ...] = ()
write_workbook: bool = True
write_previews: bool = False
model_name: str = 'Factor model'
appendix_table: DataFrame | None = None
appendix_title: str = 'Coverage and estimation quality'
appendix_subtitle: str = ''
appendix_notes: tuple[str, ...] = ()
report_name: str | None = None
cluster_labels: Mapping[str, str]
portfolio_r2: float | None = None
factor_beta_intervals: DataFrame | None = None
beta_interval_confidence: float = 0.95
beta_interval_label: str = 'WLS-HAC benchmark'
beta_interval_notes: tuple[str, ...] = ()
beta_interval_target: str = 'benchmark'
beta_interval_kind: str = 'confidence'
beta_interval_display: str = 'overlay'