abaquant.risk.dashboard

Import path: abaquant.risk.dashboard

Domain: Integrated portfolio and credit-risk dashboards.

Purpose

Integrated portfolio and credit risk dashboard.

When to use it

Use this package to combine backtest, drawdown, contribution, correlation, and credit information into one review surface.

Public objects

  • class: RiskDashboardSummary — Compact summary of an integrated risk dashboard. * RiskDashboardSummary.as_dict — Return a serialization-friendly nested summary mapping.

  • class: RiskDashboard — Combine portfolio risk, backtest, correlation, and credit diagnostics. * RiskDashboard.summary — Return nested portfolio, risk-contribution, credit, and correlation summaries. * RiskDashboard.portfolio_summary — Return scalar portfolio performance and drawdown diagnostics. * RiskDashboard.portfolio_returns — Return weighted periodic portfolio returns. * RiskDashboard.equity_curve — Return the dashboard portfolio equity curve. * RiskDashboard.drawdown — Return portfolio drawdowns from the backtest or weighted returns. * RiskDashboard.correlation — Return the asset return correlation matrix. * RiskDashboard.correlation_summary — Return aggregate asset-correlation diagnostics. * RiskDashboard.risk_contribution — Return variance-covariance asset risk contributions. * RiskDashboard.risk_contribution_summary — Return concentration diagnostics from the risk-contribution table. * RiskDashboard.credit_scores — Return a credit-proxy score table for all supplied assessments. * RiskDashboard.credit_summary — Return aggregate diagnostics for supplied credit-proxy assessments. * RiskDashboard.report — Return an exportable report for this integrated risk dashboard. * RiskDashboard.visual_report — Return a dictionary of dashboard figures keyed by chart name. * RiskDashboard.visualize — Return a dashboard figure for risk, drawdown, credit, or correlation.

Detailed reference

Integrated portfolio and credit risk dashboard.

Purpose

This module combines portfolio return diagnostics, risk-contribution estimates, optional backtest drawdowns, asset correlations, and fundamental credit-proxy assessments into one applied dashboard object.

Conventions

Portfolio returns are periodic simple returns. Volatility and covariance figures are annualized with periods_per_year. Risk contributions use the standard variance-covariance decomposition where each asset contribution to portfolio volatility is weight_i * (Sigma * weight)_i / portfolio_volatility.

Scope and limitations

The dashboard is an aggregation and reporting layer. It does not replace point-in-time data controls, portfolio construction, model validation, or investment advice. Credit inputs remain the transparent synthetic proxy scores produced elsewhere in AbaQuant.

class abaquant.risk.dashboard.RiskDashboardSummary(portfolio, risk_contribution, credit, correlation, provenance=None)

Bases: object

Compact summary of an integrated risk dashboard.

Parameters:
  • portfolio (Mapping[str, float | str | None]) – Scalar portfolio and backtest diagnostics.

  • risk_contribution (Mapping[str, float | str | None]) – Concentration diagnostics derived from volatility contributions.

  • credit (Mapping[str, object]) – Aggregate credit-proxy score diagnostics.

  • correlation (Mapping[str, float | None]) – Aggregate asset-correlation diagnostics.

  • provenance (DataProvenance | None)

as_dict()

Return a serialization-friendly nested summary mapping.

Return type:

dict[str, object]

class abaquant.risk.dashboard.RiskDashboard(portfolio, credit_assessments=None, *, weights=None, backtest=None, annual_risk_free_rate=None, periods_per_year=None)

Bases: object

Combine portfolio risk, backtest, correlation, and credit diagnostics.

Parameters:
  • portfolio (object) – Portfolio source. Supported inputs are a pandas return DataFrame, a PortfolioAllocator-style object exposing context.periodic_returns, a PortfolioBacktestResult-style object exposing returns(), or an object exposing backtest().

  • credit_assessments (Mapping[str, object], optional) – Fundamental credit-proxy assessments keyed by asset symbol. Assessment objects may expose synthetic_credit_proxy_score, synthetic_credit_proxy_band, available_score_weight, and metrics; dictionary-like rows with the same keys are also accepted.

  • weights (sequence, pandas.Series, or mapping, optional) – Portfolio weights used for static risk-contribution diagnostics. Equal weights are used when omitted.

  • backtest (object, optional) – Precomputed backtest result. If omitted and portfolio exposes a backtest method, a deterministic default backtest is created.

  • annual_risk_free_rate (float, default=0.0) – Annualized risk-free rate used when summary metrics must be computed directly from returns rather than delegated to a backtest result.

  • periods_per_year (int, default=252) – Number of return observations interpreted as one year.

summary()

Return nested portfolio, risk-contribution, credit, and correlation summaries.

Return type:

dict[str, object]

portfolio_summary()

Return scalar portfolio performance and drawdown diagnostics.

Return type:

dict[str, float | str | None]

portfolio_returns()

Return weighted periodic portfolio returns.

Return type:

Series

equity_curve(initial_value=1.0)

Return the dashboard portfolio equity curve.

Parameters:

initial_value (float)

Return type:

Series

drawdown()

Return portfolio drawdowns from the backtest or weighted returns.

Return type:

Series

correlation()

Return the asset return correlation matrix.

Return type:

DataFrame

correlation_summary()

Return aggregate asset-correlation diagnostics.

Return type:

dict[str, float | None]

risk_contribution()

Return variance-covariance asset risk contributions.

Return type:

DataFrame

risk_contribution_summary()

Return concentration diagnostics from the risk-contribution table.

Return type:

dict[str, float | str | None]

credit_scores()

Return a credit-proxy score table for all supplied assessments.

Return type:

DataFrame

credit_summary()

Return aggregate diagnostics for supplied credit-proxy assessments.

Return type:

dict[str, object]

report()

Return an exportable report for this integrated risk dashboard.

Returns:

Report object with Markdown, HTML, and PDF export methods.

Return type:

ExportableReport

visual_report(*, charts=('risk_contribution', 'drawdown', 'credit_scores', 'correlation'), backend=None, theme=None, save_path=None)

Return a dictionary of dashboard figures keyed by chart name.

Parameters:
  • charts (Sequence[str])

  • backend (str | None)

  • save_path (str | Path | None)

Return type:

dict[str, object]

visualize(*, chart='risk_contribution', backend=None, theme=None, save_path=None, filename=None)

Return a dashboard figure for risk, drawdown, credit, or correlation.

Parameters:
  • chart (str)

  • backend (str | None)

  • save_path (str | Path | None)

  • filename (str | None)