Add Unserved energy Conditional Value at Risk (CVAR) metric#100
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #100 +/- ##
==========================================
+ Coverage 83.13% 83.16% +0.02%
==========================================
Files 45 45
Lines 2325 2429 +104
==========================================
+ Hits 1933 2020 +87
- Misses 392 409 +17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…capacity calculations
Agent-Logs-Url: https://github.com/NatLabRockies/PRAS/sessions/012d8c7b-67f5-45ad-82ee-c3db6a6e2379 Co-authored-by: abdelrahman-ayad <70848794+abdelrahman-ayad@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
sriharisundar
left a comment
There was a problem hiding this comment.
Please address any explicit comments I have here (moving _cvar and _ncvar to utils.jl, potentially rename dim to quantity, print CVAR unit based on dim rather than just using E), and merge!
|
LGTM, please squash and merge. We will update versions across packages when we merge couple other PRs. Thanks for the patience :) |
|
Thanks Hari, will merge now. |
Summary
This PR adds the Conditional Value at Risk (CVAR) metric to quantify tail-risk shortfalls in resource adequacy assessments. CVAR measures the expected unserved energy across the worst (1−α) simulation samples, where α is a user-defined confidence level (e.g., 0.95).
This PR implements CVAR for unserved energy on both
ShortfallResultandShortfallSamplesResult. CVAR for other dimensions (duration, magnitude) is out of scope and left for a follow-up.Methodology
CVAR is computed as the weighted average of total unserved energy samples that exceed the α-th percentile (VAR). For
ShortfallResult, an additional vector of per-sample total unserved energy is accumulated during simulation and discarded after CVAR computation (Type 1 in figure below).implementation
Performance testing
@benchmarktesting forShortfallandShortfallSamples. There is a slight increase in memory use in theShortfalldue to the additional vector storing the total unserved energy across all samples.