GEMScienceTools / oq-mbtk

OpenQuake Model Building Toolkit, a suite of tools for building components and analysing models for PSHA.
https://gemsciencetools.github.io/oq-mbtk/index.html
GNU Affero General Public License v3.0
14 stars 8 forks source link

Stochastic area metric + refactoring and utility functions #422

Closed CB-quakemodel closed 4 weeks ago

CB-quakemodel commented 2 months ago

PR includes:

1) Adding stochastic area metric of Sunny et al. (2021): This is the absolute difference of the integral of the CDF of the GMM predictions and the ECDF of the observed values. We compute this for each imt to provide a plot as obtained per imt for EDR and LLH. Functions to export the data and compute weights through normalisation of these weights is also added. Unit tests are also added + documentation and demo files are updated too. Sanity checks have been performed using the Albania analysis - the 3 GMMs we picked are the best performing against Albania ESM data also according to the stochastic area metric, and therefore are in good agreement with the findings using EDR and LLH.

2) Also removed the deprecated old classes for EDR, LLH etc. These classes are all now callable from the residuals object itself so are no longer needed. Tests are modified accordingly. The old unit test for the ranking metrics has been removed as it is in effect only checking execution of values - much simpler new unit tests checking the same executions have been added within the residuals unit test.

3) Reorganising and refactoring much of the code to be placed in appropriate modules and to be much simpler. Most of the sm_database code has been moved into the residuals module. Also some small utility functions added e.g. ability to plot the events, stations and country borders of a parsed database through use of new functions in engine.