Aggregate (per-year) loss exceedance curves (AEP)

178 views
Skip to first unread message

thanas...@gmail.com

unread,
Jun 11, 2020, 9:11:57 AM6/11/20
to OpenQuake Users

Hi all,


As far as I understand, the only way to compute per-year loss exceedance curves is to set ses_per_logic_tree_path = 1 and investigation_time = N (e.g. 100,000), instead of the opposite, and then post-process the results stored in the losses_by_event.csv file (taking advantage of the “year” column).


1)      1) For my analysis I have specified an investigation_time of 100,000 years, however I noticed that the year column contains values up to about 65,000 (for about 20,000 ruptures). I changed the random seed just in case it was some very unlikely statistical fluke, but I got the same thing. Could you help me understand how this works?


2)      2) I would like to have the event loss table by tag as well. Among other things, this would allow to obtain the per-year loss exceedance curves for each tag (=administrative unit). Is there any way that I could be able to extract such information (I didn’t find anything in the hdf5 file), and if not, do you foresee that something like that could be possible in the future?


Many thanks  

Michele Simionato

unread,
Jun 12, 2020, 12:23:37 AM6/12/20
to OpenQuake Users

On Thursday, June 11, 2020 at 3:11:57 PM UTC+2, thanas...@gmail.com wrote:

Hi all,


As far as I understand, the only way to compute per-year loss exceedance curves is to set ses_per_logic_tree_path = 1 and investigation_time = N (e.g. 100,000), instead of the opposite, and then post-process the results stored in the losses_by_event.csv file (taking advantage of the “year” column).



You can also set ses_per_logic_tree_path = N and investigation_time = 1 and then take the ses_id field as the year, if your model is time independent, but probably it is not more convenient.

1)      1) For my analysis I have specified an investigation_time of 100,000 years, however I noticed that the year column contains values up to about 65,000 (for about 20,000 ruptures). I changed the random seed just in case it was some very unlikely statistical fluke, but I got the same thing. Could you help me understand how this works?



The "year" is assumed to be a 2 byte integer so it is silently truncated by numpy to a maximum value of 65535. This is no good. We need to raise an error or to use a larger integer, we will discuss this internally.
 


2)      2) I would like to have the event loss table by tag as well. Among other things, this would allow to obtain the per-year loss exceedance curves for each tag (=administrative unit). Is there any way that I could be able to extract such information (I didn’t find anything in the hdf5 file), and if not, do you foresee that something like that could be possible in the future?


There is already an asset loss table per tag in engine 3.9. For instance if you run demos/risk/EventBasedRisk/job_eb.ini and you look inside the datastore you will find datasets

event_loss_table/1,1
event_loss_table/1,2
...

event_loss_table/5,5

where the first index refers to NAME_1 and the second to taxonomy (because the demo has aggregate_by = NAME_1, taxonomy).
For instance event_loss_table/1,1 is the event loss table for NAME_1="Mid-Western" and taxonomy="Wood".
The association tag name -> tag number are inside the datagroup assetcol/tagcol
HTH,

                   Michele



anirudh.rao

unread,
Jun 12, 2020, 2:14:35 AM6/12/20
to OpenQuake Users
Starting from engine 3.9, the ses_id is also listed in the events table. Here's an example: https://github.com/gem/oq-engine/blob/master/openquake/qa_tests_data/event_based/case_1/expected/events.csv

Thus, you can now compute the AEP curves also by setting investigation_time = 1 and using the ses_id to aggregate losses within each 1-year event set.


On Thursday, June 11, 2020 at 3:11:57 PM UTC+2, thanas...@gmail.com wrote:

thanas...@gmail.com

unread,
Jun 12, 2020, 5:36:32 AM6/12/20
to OpenQuake Users
Dear Michele and Anirudh,

Many thanks for your quick responses. I was not reading the datastore properly, I found it now, thanks again.

I see that the ses_id variable is also stored as '<u2', so I guess I might need to combine ses_per_logic_tree_path and investigation_time values to get 100,000 years/ses while keeping each of them below 65535.

Regards,
TP

Michele Simionato

unread,
Jun 12, 2020, 8:25:22 AM6/12/20
to OpenQuake Users


On Friday, June 12, 2020 at 11:36:32 AM UTC+2, thanas...@gmail.com wrote:
Dear Michele and Anirudh,

Many thanks for your quick responses. I was not reading the datastore properly, I found it now, thanks again.

I see that the ses_id variable is also stored as '<u2', so I guess I might need to combine ses_per_logic_tree_path and investigation_time values to get 100,000 years/ses while keeping each of them below 65535.

Both ses_id and year have been changed to '<u4' in current master.

           Michele 
 

Y Z

unread,
Sep 2, 2021, 10:22:26 AM9/2/21
to OpenQuake Users
Dear Michele and Anirudh

Just related with the AEP and OEP question, I try to extract them from Event loss table. But many events occurred in same year, so the AEP is not feasible to extract. Here is the key settings for Papua New Guinea calculation:

Number_of_logic_tree_samples = 108 (total number of realizations is 108)
Investigation_time = 10000
Ses_per_logic_tree_path = 1

Where, 151,633,164 events generated in hazard section and most of them triggered loss. So ~15000 events per investigation year. It's not reasonable. May I know where is the problem?

Thanks,
Youbing.

Anirudh Rao

unread,
Sep 2, 2021, 11:21:03 AM9/2/21
to openqua...@googlegroups.com
Hi Youbing,

Given your parameters, the engine is generating a 10,000 year long event set for each of the 108 sampled branches. Thus, the average number of events per year is 151 million ÷ 10,000 years  ÷ 108 branches ≅ 140 events per year (and not 15,000 per year). You can split the event loss table by the realisation or sampled branch id (rlz_id) and after aggregating the event losses within each year, calculate the AEP for each sampled branch (i.e., 108 AEP curves), and then obtain the (weighted or unweighted) mean AEP from the individual branch curves.

More information about the parameters investigation_time, ses_per_logic_tree_path, and number_of_logic_tree_samples can be found in the second FAQ on this page: https://github.com/gem/oq-engine/blob/engine-3.11/doc/faq-risk.md

Hope this helps!

Best regards,
Anirudh

Best regards,
ANIRUDH RAO    seismic risk engineer    LinkedIn: Anirudh Rao    +39-0382-5169-936
GLOBAL EARTHQUAKE MODEL    working together to assess risk
GEM —  globalquakemodel.org     @GEMwrld      GEMwrld


--
You received this message because you are subscribed to the Google Groups "OpenQuake Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openquake-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openquake-users/054aae31-de09-4f94-a1e5-67ca1524779en%40googlegroups.com.

Y Z

unread,
Sep 13, 2021, 10:24:22 AM9/13/21
to OpenQuake Users
Thanks Anirudh

For the OEP calculation, can I just pick up the event causing largest loss in each year (regardless from which realisations ), and the event rate = 1/(ses * investigation time * logic tree), then sort the losses in descending order? Thanks.

Best wishes,
Youbing,

anirudh.rao

unread,
Sep 14, 2021, 10:22:47 AM9/14/21
to OpenQuake Users
Hi Youbing,

You can calculate the OEP for each realization separately and then get the (weighted or unweighted) mean OEP similar to the case of the AEP but picking the largest loss event in each year instead of the aggregate loss per year. Or as you describe, you could also decide to pool together all realizations and compute a single OEP.

Best regards,
Anirudh

Reply all
Reply to author
Forward
0 new messages