Risk Quantification¶
After solving a scenario program, the complexity k (number of support constraints) and the sample size N are used to compute distribution-free bounds on the probability of constraint violation — the risk — without requiring any knowledge of the underlying probability distribution.
Scenario Approach Background¶
Consider a decision variable \(x \in \mathcal{X} \subset \mathbb{R}^d\) and an uncertain parameter \(\delta \in \Delta \subset \mathbb{R}^q\) drawn i.i.d. from an unknown probability measure \(\mathbb{P}\). For each scenario \(\delta\), the set \(\mathcal{X}_\delta \subseteq \mathcal{X}\) denotes the region of feasible decisions. The scenario program is:
Given the optimal solution \(x_N^*\), the risk quantifies the probability that a newly drawn scenario renders the solution inappropriate:
Since \(\mathbb{P}\) is unknown, the scenario approach provides distribution-free bounds on \(V(x_N^*)\) using only the complexity \(s_N^*\) — the cardinality of the smallest irreducible subset of scenarios that fully determines the solution.
Support Constraints and Complexity¶
A support list is a sublist \((\delta_{i_1}, \ldots, \delta_{i_k})\) of the scenarios such that:
Solving the program with only these scenarios yields the same solution \(x_N^*\).
The sublist is irreducible: removing any single scenario changes the solution.
The complexity \(s_N^*\) is the minimal cardinality among all support lists. This is the
value k computed by get_support() and passed to
quantify_risk().
Risk Bounds¶
Upper Bound (Always Valid)¶
The upper bound on risk holds under the sole assumption of consistency (which is guaranteed for all convex optimization problems handled by Scen-Opt). For a prescribed confidence level \(1 - \beta\), the risk certificate of Garatti and Campi [GC2025] states:
where \(\epsilon(k) = 1 - t(k)\) and \(t(k) \in (0,1)\) is the unique solution of
with the convention \(\epsilon(N) = 1\).
Two-Sided Bounds (Requires Non-Degeneracy)¶
Under the additional assumption of non-degeneracy (there exists a unique support list), a two-sided certificate from Garatti and Campi [GC2022] provides both lower and upper bounds. For \(k = 0, 1, \ldots, N-1\), consider the polynomial equation in \(t\):
This admits exactly two solutions in \([0, +\infty)\), denoted \(\underline{t}(k) \leq \overline{t}(k)\). For \(k = N\), a separate equation yields a single solution \(\overline{t}(N)\), with \(\underline{t}(N) = 0\). The bounds are:
and the two-sided risk certificate reads:
Scen-Opt computes these bounds numerically via bisection using the regularized incomplete beta function, following the procedure described in [CGC2023].
Warning
The lower bound \(\underline{\epsilon}\) is valid only when the non-degeneracy
assumption holds. If Scen-Opt detects degeneracy during active constraint identification
(indicated by the degeneracy flag in the solver output), the lower bound should be
disregarded and only the upper bound \(\overline{\epsilon}\) used. While Scen-Opt
attempts to detect degeneracy automatically, such checks cannot cover out-of-sample
scenarios — it is the user’s responsibility to assess whether the lower bound remains
applicable.
Tip
A common choice is \(\beta = 10^{-6}\). Smaller values of \(\beta\) give wider bounds but higher confidence.
API Reference¶
- src.Risk.quantify_risk(k, N, beta)[source]¶
Compute scenario approach risk bounds on constraint violation probability.
Uses the theory of Campi and Garatti with the regularized incomplete beta function to compute distribution-free bounds on the probability of out-of-sample constraint violation via bisection.
The true violation probability satisfies:
\[\varepsilon \;\in\; [\varepsilon_L,\; \varepsilon_U] \quad \text{with confidence at least } 1 - \beta\]- Parameters:
k (int) – Cardinality of the support list from the scenario optimization.
N (int) – Number of sampled scenarios.
beta (float) – Confidence parameter (e.g.
1e-6for high confidence).
- Returns:
epsL (float) – Lower bound on the constraint violation probability.
epsU (float) – Upper bound on the constraint violation probability.
- Raises:
ValueError – If
N < 1,kis not between 0 andN, orbetais not strictly between 0 and 1.
Notes
The incomplete beta function
betaincused here follows the JAX/SciPy argument convention, which differs from MATLAB (the first argument appears last in JAX).
References¶
S. Garatti and M. C. Campi, “Non-convex scenario optimization,” Mathematical Programming, vol. 209, no. 1, pp. 557–608, 2025.
S. Garatti and M. C. Campi, “Risk and complexity in scenario optimization,” Mathematical Programming, vol. 191, no. 1, pp. 243–279, 2022.
M. C. Campi and S. Garatti, “Compression, generalization and learning,” Journal of Machine Learning Research, vol. 24, no. 339, pp. 1–74, 2023.