Skip to content

LOLD Implementation#108

Open
akrivi wants to merge 12 commits into
mainfrom
al/LOLD
Open

LOLD Implementation#108
akrivi wants to merge 12 commits into
mainfrom
al/LOLD

Conversation

@akrivi

@akrivi akrivi commented May 11, 2026

Copy link
Copy Markdown
Collaborator

This PR:

  • Implements the Loss of Load Days (LOLD) metric as defined in [1]
  • Adds a new documentation page: "Interpreting Resource Adequacy Metrics"

Mathematical formulation

We define the Loss of Load Days (LOLD) metric as:

$$ \mathrm{LOLD} = \mathbb{E}\left[\sum_{d} I_{d,s}\right] $$

where:

$$ I_{d,s} = \begin{cases} 1 & \text{if } \exists t \in {T}(d) \text{ such that } \sum_r S_{r,t,s} > 0 \\ 0 & \text{otherwise} \end{cases} $$

and

  • $r$ indexes regions in the system
  • $t$ indexes timestamps
  • $d$ indexes calendar days
  • $s$ indexes Monte Carlo samples
  • $S_{r,t,s}$ is the shortfall in region $r$, time $t$, sample $s$
  • ${T}(d)$ is the set of all time periods belonging to day $d$

We note that LOLD is not naturally defined at a single timestamp, since it aggregates over all time periods within a day. As a result, additional computation is needed compared to LOLE, namely:

  1. grouping time periods by calendar day
  2. aggregating within each day

Benchmarks

Complexity wise, the system wide and full-horizon LOLD scales with total simulation size, while the day-specifc queries scale only with the size of the selected day.

We also provide below a comparison of the benchmarks between LOLD and LOLE:
Screenshot 2026-03-23 at 23 07 27

References:
[1] G. Stephen et al., "Clarifying the Interpretation and Use of the LOLE Resource Adequacy Metric," 2022 17th International Conference on Probabilistic Methods Applied to Power Systems (PMAPS), Manchester, United Kingdom, 2022, pp. 1-4, doi: 10.1109/PMAPS53380.2022.9810615.

@akrivi akrivi changed the title Al/lold LOLD Implementation May 11, 2026
@codecov-commenter

codecov-commenter commented May 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.05941% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.59%. Comparing base (11d3003) to head (221441f).

Files with missing lines Patch % Lines
PRASCore.jl/src/Results/ShortfallSamples.jl 92.30% 3 Missing ⚠️
PRASCore.jl/src/Results/utils.jl 90.32% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #108      +/-   ##
==========================================
+ Coverage   83.13%   83.59%   +0.45%     
==========================================
  Files          45       45              
  Lines        2325     2426     +101     
==========================================
+ Hits         1933     2028      +95     
- Misses        392      398       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread PRAS.jl/examples/pras_adequacy_metrics.jl
Comment thread PRAS.jl/examples/pras_adequacy_metrics.jl
Comment thread PRAS.jl/examples/pras_walkthrough.jl Outdated
Comment thread PRASCore.jl/test/Simulations/runtests.jl

@abdelrahman-ayad abdelrahman-ayad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work Akrivi! I left a couple of very minor comments. Can we also include metrics tests in the test/Results/metrics.jl ?

@akrivi akrivi requested a review from abdelrahman-ayad June 10, 2026 01:46
@sriharisundar sriharisundar mentioned this pull request Jun 12, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants