qis.run_portfolio_stress_test

qis.run_portfolio_stress_test(portfolio, scenarios, historical_factor_log_returns=None, factor_grids=None, config=None)[source]

Revalue requested, conditional, historical and grid shocks through one portfolio.

No estimation, provider access, plotting or file output occurs here. Current risk is a local derivative calculation; intrinsic stress P&L uses full payoffs.

Parameters:
  • portfolio (InstrumentPortfolio) – Validated absolute-position snapshot referencing a QIS RiskModel.

  • scenarios (StressScenarios) – Requested factor/family anchors with explicit units and completion.

  • historical_factor_log_returns (DataFrame | None) – Optional complete-factor monthly log-return panel. Incomplete rows and rows after the valuation date are reported and excluded.

  • factor_grids (Mapping[str, StressScenarios] | None) – Caller-named grid requests; row labels are retained as the displayed axis.

  • config (StressTestConfig | None) – Optional explicit risk horizon, ranking and band policies.

Returns:

Detached numerical result usable by reporting, workbooks or a consumer dashboard.

Return type:

PortfolioStressResult