-
Notifications
You must be signed in to change notification settings - Fork 29
Add Conditional Value at Risk (CVAR) metric #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
abdelrahman-ayad
wants to merge
27
commits into
main
Choose a base branch
from
aa/CVAR
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
bd3c07a
initial CVAR functions commit
abdelrahman-ayad b1f105a
added normalized CVAR (NCVAR)
abdelrahman-ayad e633074
formulate normalized CVAR based on CVAR struct
abdelrahman-ayad fac883c
broadcast CVAR and NCVAR - to check
abdelrahman-ayad 37ab22c
broadcast CVAR and NCVAR - to check
abdelrahman-ayad 2091f49
add tests for CVAR and NCVAR
abdelrahman-ayad 04e6f25
CVAR and NCVAR shortfall and metrics test
abdelrahman-ayad 3547a87
broadcast CVAR and NCVAR functions
abdelrahman-ayad 1140338
report var value and add field to distinguish between period and samp…
abdelrahman-ayad dac2262
Shortfall based CVAR - worst periods
abdelrahman-ayad a8dd8dd
add type field for CVAR and store var
abdelrahman-ayad a8c3e7f
add ShortfallResult tests
abdelrahman-ayad 0439599
metrics.jl update
abdelrahman-ayad 6dded9d
add unservedload_sample and unservedload_region_sample to ShortfallAc…
abdelrahman-ayad 5613f0b
update CVAR implementation in ShortfallSamples to include energy and …
abdelrahman-ayad 5befde4
update to the recording and reset! functions
abdelrahman-ayad 914e541
udpate TestData with the CVAR values
abdelrahman-ayad 5bf96cf
update DummyData with CVAR values
abdelrahman-ayad a979801
include CVAR tests
abdelrahman-ayad 35579e2
rename capacity_cvar
abdelrahman-ayad 0959c23
add capacity_cvar to shortfall and shortfallsamples
abdelrahman-ayad 59e7983
update Dummydata
abdelrahman-ayad 7a610f6
CVAR capacity tests
abdelrahman-ayad 2afb0c2
addressing minor comments from Copilot
abdelrahman-ayad f6438e5
add CVAR/NCVAR to docs
abdelrahman-ayad fe596cf
change `capacity_shortfall` to float to pass tests
abdelrahman-ayad 8de1ba0
remove the copy function
abdelrahman-ayad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,49 @@ | ||
| using PRAS | ||
| using Test | ||
|
|
||
| sys = PRAS.rts_gmlc() | ||
| @testset "ShortfallResult" begin | ||
| sys = PRAS.rts_gmlc() | ||
|
|
||
| sf, = assess(sys, SequentialMonteCarlo(samples=100), Shortfall()) | ||
| sf, = assess(sys, SequentialMonteCarlo(samples=100), Shortfall()) | ||
|
|
||
| eue = EUE(sf) | ||
| lole = LOLE(sf) | ||
| neue = NEUE(sf) | ||
| eue = EUE(sf) | ||
| lole = LOLE(sf) | ||
| neue = NEUE(sf) | ||
|
|
||
| @test val(eue) isa Float64 | ||
| @test stderror(eue) isa Float64 | ||
| @test val(neue) isa Float64 | ||
| @test stderror(neue) isa Float64 | ||
| alpha = 0.95 | ||
| cvar = CVAR(sf, alpha) | ||
| ncvar = NCVAR(sf, cvar) | ||
|
|
||
| @test val(eue) isa Float64 | ||
| @test stderror(eue) isa Float64 | ||
| @test val(neue) isa Float64 | ||
| @test stderror(neue) isa Float64 | ||
| @test val(cvar) isa Float64 | ||
| @test stderror(cvar) isa Float64 | ||
| @test val(ncvar) isa Float64 | ||
| @test stderror(ncvar) isa Float64 | ||
|
|
||
| end | ||
|
|
||
| @testset "ShortfallSamplesResult" begin | ||
| sys = PRAS.rts_gmlc() | ||
|
|
||
| sf, = assess(sys, SequentialMonteCarlo(samples=100), ShortfallSamples()) | ||
|
|
||
| eue = EUE(sf) | ||
| lole = LOLE(sf) | ||
| neue = NEUE(sf) | ||
|
|
||
| alpha = 0.95 | ||
| cvar = CVAR(sf, alpha) | ||
| ncvar = NCVAR(sf, cvar) | ||
|
|
||
| @test val(eue) isa Float64 | ||
| @test stderror(eue) isa Float64 | ||
| @test val(neue) isa Float64 | ||
| @test stderror(neue) isa Float64 | ||
| @test val(cvar) isa Float64 | ||
| @test stderror(cvar) isa Float64 | ||
| @test val(ncvar) isa Float64 | ||
| @test stderror(ncvar) isa Float64 | ||
| end |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.