Skip to content

Commit

Permalink
Points-based hazard model test (#154)
Browse files Browse the repository at this point in the history
* Tidy and points-based hazard model
* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Joe Moorhouse <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
joemoorhouse and pre-commit-ci[bot] authored Oct 20, 2023
1 parent 3cc9e5b commit 4ac76df
Show file tree
Hide file tree
Showing 20 changed files with 348 additions and 301 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ to allow running of tests within the IDE.
## Releasing
Actions are configured to release to PyPI on pushing a tag. In order to do this:
- Update VERSION
- Create new annotated tag and push
- Create new annotated tag and push
```
git tag -a v1.0.0 -m "v1.0.0"
git push --follow-tags
Expand Down
22 changes: 10 additions & 12 deletions docs/handbook/onboarding.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Onboarding a new model/data
===========================

Exceedance curves
Exceedance curves
-----------------

The starting point of the calculation is a curve of hazard event intensities, obtained at the location of one particular asset. The probability of occurrence is given either by the 'return period' or an 'exceedance probability'. The return period is the average time in years between occurrences of an event that exceeds a given intensity. The exceedance probability is the probability that in a year an event occurs that exceeds the given intensity. Exceedance probability is the reciprocal of the return period.
The starting point of the calculation is a curve of hazard event intensities, obtained at the location of one particular asset. The probability of occurrence is given either by the 'return period' or an 'exceedance probability'. The return period is the average time in years between occurrences of an event that exceeds a given intensity. The exceedance probability is the probability that in a year an event occurs that exceeds the given intensity. Exceedance probability is the reciprocal of the return period.

.. image:: onboarding/return_periods.png
:width: 500

.. image:: onboarding/exceedance_curve.png
:width: 500

Expand Down Expand Up @@ -36,7 +36,7 @@ In general, a Vulnerability/Event Model is responsible for obtaining for a parti
The damage or disruption is sometimes referred to as the 'impact'.

The current implementation is non-parametric and based on discrete bins - although continuous versions of :code:`HazardEventDistrib`/:code:`VulnerabilityDistrib` could certainly be added, based on particular parametric distributions.

:code:`HazardEventDistrib` is in this non-parametric version a histogram of hazard event intensities: defines a set of intensity bins and the annual probability of occurrence.

:code:`VulnerabilityDistrib` is a matrix that provides the probability that if an event occurs with intensity falling in a particular intensity bin, an impact in a particular impact bin occurs.
Expand All @@ -53,14 +53,14 @@ The model applies to:
* A type of hazard event (Inundation, Wildfire, Drought, etc)
* A type of asset (residential property, power generating asset, etc)

Decorators are used to 'tag' a model, so that an appropriate model can be selected for a given asset and hazard type; configuration allows types of :code:`Model` to be used in preference to other candidates.
Decorators are used to 'tag' a model, so that an appropriate model can be selected for a given asset and hazard type; configuration allows types of :code:`Model` to be used in preference to other candidates.

Specific types of model also exist for common modelling approaches. In particular, although in general it is desirable that a model has the flexibility to define its hazard event distribution and vulnerability distribution, in many cases the former will be sourced directly from a data set and it only remains to define the vulnerability distribution. The :code:`Model` class allows the general form of the model to be implemented. The :code:`VulnerabilityModel` class is for cases where only the vulnerability is to be specified.

On-boarding a model based on a damage/disruption curve
------------------------------------------------------

A vulnerability distribution can be inferred directly from a damage/disruption curve:
A vulnerability distribution can be inferred directly from a damage/disruption curve:

.. image:: onboarding/disruption_curve.png
:width: 500
Expand All @@ -79,15 +79,13 @@ In some cases, even if a full vulnerability matrix is unavailable, an estimate o

.. image:: onboarding/damage_with_uncertainty.png
:width: 500
source: Huizinga et al. 'Global flood depth-damage functions: methodology and the database with guidelines'
In such cases :code:`VulnerabilityModel` can be used to specify the close-formed conditional probability distribution to be used for a given intensity level. The cumulative probability density function is expected, and is provided via an :code:`ImpactCurve` by implementing method :code:`get_impact_curve`.
source: Huizinga et al. 'Global flood depth-damage functions: methodology and the database with guidelines'

In such cases :code:`VulnerabilityModel` can be used to specify the close-formed conditional probability distribution to be used for a given intensity level. The cumulative probability density function is expected, and is provided via an :code:`ImpactCurve` by implementing method :code:`get_impact_curve`.

Example models are provided to illustrate this. A model that uses beta distributions to provide a distribution yields the following :code:`VulnerabilityDistrib` in the above case:

.. image:: onboarding/vulnerability_with_uncertainty.png
:width: 500

Note that a beta distribution is a commonly-used heuristic; its functional form is convenient for vulnerability distributions although there appears to be limited justification for its use beyond providing a convenient means to apply uncertainty to a vulnerability distribution.


Note that a beta distribution is a commonly-used heuristic; its functional form is convenient for vulnerability distributions although there appears to be limited justification for its use beyond providing a convenient means to apply uncertainty to a vulnerability distribution.
Loading

0 comments on commit 4ac76df

Please sign in to comment.