Conversation
New compute_cvar option adds cvar_lower/cvar_upper outputs alongside the confidence intervals, using the same tail convention (alpha=0.05 gives the mean of the worst 2.5% tail). - CVaRComp: exact sample CVaR in the Rockafellar-Uryasev form VaR + mean((x - VaR)+)/(alpha/2) on the resampled responses, with the same aleatory/epistemic handling as CDFComp. - CVaRGroup (use_tanh_ci=True): solves the tanh-smoothed confidence interval with the same CDFResidComp/BalanceComp machinery as CDFGroup, then CVaRTailComp evaluates the Rockafellar-Uryasev form with a softplus hinge. softplus >= relu makes the smoothing bias outward (conservative) on both tails, mirroring the tanh CI bias. KS aggregation across epistemic curves as in CDFGroup. Verified: exact form matches numpy references to 1e-6 and analytic normal CVaR; totals match FD to ~1e-8 in both modes; conservative bias direction asserted. 10 new unit tests; full mdao suite (24) passes.
…I, CVaR
Analytical hello-world for the UQPCE optimization statistics, built on
the GMM example's uncertainty model (multimodal GMM + uniform + normal,
same input.yaml / run_matrix.dat). A two-variable quadratic amplifies
the unbounded multimodal input through x and the bounded uniform input
through y, so each objective picks a visibly different design:
deterministic sits at the target, worst spread and tail
mean best expected value, widest distribution
mean_plus_var narrowest distribution, largest mean penalty
ci_upper best 97.5th percentile
cvar_upper best tail mean; shifts exposure off the unbounded
input relative to ci_upper
The model is quadratic in the uncertain inputs so the order-2 PCE is
exact; each design provably minimizes its own column of the printed
statistics table. Writes a design-space / CDF / PDF comparison figure
from an independent Monte Carlo of the true function. Reproducible
run-to-run (single-threaded math plus the seeded resampling fix).
The 95th-percentile CI and 5% CVaR separate the two tail-risk designs more clearly than the 2.5% tail did: the optima are visibly distinct in the design space and each still minimizes its own statistic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds conditional value at risk (CVaR) as a differentiable statistic alongside the existing confidence intervals, for use as an optimization objective or constraint.
API
A new
compute_cvaroption (defaultFalse) onUQPCEGroup/MultiUQPCEGroupaddscvar_lower/cvar_upperoutputs next toci_lower/ci_upper, with the same tail convention:significance=0.05gives the mean of the worst 2.5% tail, so each CVaR pairs with its CI. The existinguse_tanh_ciflag selects the implementation, exactly as it does for the CI.Exact form (
use_tanh_ci=False)CVaRComp, a JAX component computing the Rockafellar-Uryasev formon the resampled responses, with the same aleatory/epistemic reshape and max/min aggregation as
CDFComp. Well defined for repeated (discrete) sample values; reduces to the conditional tail mean for continuous samples.Smoothed form (
use_tanh_ci=True)CVaRGroupsolves the tanh-smoothed confidence interval with the sameCDFResidComp/BalanceCompmachinery asCDFGroup, thenCVaRTailCompevaluates the Rockafellar-Uryasev form with a softplus hinge. Sincesoftplus >= relu, the smoothing bias is always outward -- the upper CVaR is overestimated and the lower underestimated -- mirroring the conservative bias of the tanh CI. Bias scales asomega^2 * density / tail_frac. KS aggregation across epistemic curves as inCDFGroup.Verification
test_suite/test_uqpce/mdao/cvar/, mirroring thecdftest layout; the full mdao suite passes.Example
examples/GMM/objectives_comparison_example.pyoptimizes the same two-variable analytical problem (built on the GMM example's uncertainty model) under each statistic -- deterministic,mean,mean_plus_var,ci_upper,cvar_upper-- and each design provably minimizes its own column of the printed statistics table. The model is quadratic in the uncertain inputs so the order-2 PCE is exact, and the CI-vs-CVaR distinction is interpretable: CVaR shifts exposure away from the unbounded multimodal input and onto the bounded one. Writes a design-space/CDF/PDF comparison figure; reproducible run-to-run (relies on the seeding fix from #25).