Algostream_risk_management.VarValue-at-Risk and Expected Shortfall with four computation methods.
All methods produce the same result record so callers can switch between methods without changing call-site shape. method_used records which method actually ran for audit logging. Coarse-precision caveat carries over from Advanced_models.Special — claim no more than two significant figures in extreme tails.
type method_ = | HistoricalEmpirical quantile + tail mean. Wraps Algostream_domain_portfolio.Portfolio.Risk_metrics.calculate_var / calculate_expected_shortfall. Robust to non-normality but slow to react to regime changes (equally weighted history).
| Parametric_normalGaussian: VaR = -(mu + sigma * Phi^{-1}(1-alpha)). Use when returns are approximately normal.
| Cornish_fisherParametric with skewness/excess-kurtosis adjustment via Cornish-Fisher expansion. Recommended n ≥ 100; degenerate sample stats fall back to Parametric_normal.
*)| Garch_forecast of Algostream_advanced_models.Garch11.tParametric with forward-looking sigma from a fitted GARCH(1,1). Captures volatility clustering that historical sim averages out.
*)val report_to_string : result -> string