Skip to main content

Module risk

Expand description

Risk metrics over supplied return and scenario data.

These routines do not fetch market data or infer missing histories. Callers provide the return series or shocks and the output buffers.

Enums§

RiskError

Functions§

gaussian_var
Parametric Gaussian VaR as a positive loss fraction.
historical_cvar
Historical expected shortfall/CVaR as a positive average tail loss.
historical_var
Historical VaR as a positive loss fraction at confidence.
scenario_loss
Apply asset shocks to portfolio weights and return scenario portfolio loss.
scenario_losses_into
Scenario losses for row-major scenario shock matrix.
sorted_returns_into
Copy and sort returns ascending into caller-owned scratch.