Skip to content

Commit dd21493

Browse files
committed
doc(risk transfer): Improves clarity of risk transfer mechanism
1 parent 33cfff4 commit dd21493

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

climada/trajectories/impact_calc_strat.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,14 @@ def _apply_risk_transfer(
8989
)
9090

9191
def calculate_residual_or_risk_transfer_impact_matrix(
92-
self, imp_mat, risk_transf_attach, risk_transf_cover, calc_residual
92+
self, imp_mat, attachement, cover, calc_residual
9393
):
94-
"""
95-
Calculate either the residual or the risk transfer impact matrix.
94+
"""Calculate either the residual or the risk transfer impact matrix from a global risk transfer mechanism.
95+
96+
To compute the transfered risk, the function first computes for each event, the (positive) difference between their total impact and `attachment`. The transfered risk for each event is then defined as the minimum between this value and `cover`. The residual impact is the total impact minus the transfered risk.
97+
The impact matrix is then adjusted by multiply impact per centroids by the ratio between residual risk and total impact for each event. As such, the risk transfer is shared among all impacted exposure points and equaly distributed.
9698
97-
The impact matrix is adjusted based on the total impact for each event.
98-
When calculating the residual impact, the result is the total impact minus
99-
the risk layer. The risk layer is defined as the minimum of the cover and
100-
the maximum of the difference between the total impact and the attachment.
101-
If `calc_residual` is False, the function returns the risk layer matrix
102-
instead of the residual.
99+
If `calc_residual` is False, the function returns the transfered risk at each points instead of the residual risk by using the ratio between transfered risk and total impact instead.
103100
104101
Parameters
105102
----------
@@ -118,13 +115,18 @@ def calculate_residual_or_risk_transfer_impact_matrix(
118115
scipy.sparse.csr_matrix
119116
The adjusted impact matrix, either residual or risk transfer.
120117
118+
Warnings
119+
--------
120+
121+
This transfer capability is different and not exclusive with the one implemented in ImpactCalc, which is defined at the centroid level. The mechanism here corresponds to a global cover applied to the whole region studied.
122+
121123
"""
122124
imp_mat = copy.deepcopy(imp_mat)
123125
# Calculate the total impact per event
124126
total_at_event = imp_mat.sum(axis=1).A1
125127
# Risk layer at event
126128
transfer_at_event = np.minimum(
127-
np.maximum(total_at_event - risk_transf_attach, 0), risk_transf_cover
129+
np.maximum(total_at_event - attachement, 0), cover
128130
)
129131
residual_at_event = np.maximum(total_at_event - transfer_at_event, 0)
130132

climada/trajectories/riskperiod.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,13 @@ class CalcRiskPeriod:
9090
The method used to calculate the impact from the (Haz,Exp,Vul) of the two snapshots.
9191
Defaults to ImpactCalc
9292
risk_transf_attach: float, optional
93-
The attachement of risk transfer to apply. Defaults to None.
93+
A global attachement of risk transfer to apply. Note that this is different (and not exclusive) from the attachement
94+
that can be defined in the `Exposures` object. Defaults to None.
9495
risk_transf_cover: float, optional
95-
The cover of risk transfer to apply. Defaults to None.
96+
A global cover of risk transfer to apply. See `risk_transf_attach` above. Defaults to None.
9697
calc_residual: bool, optional
97-
A boolean stating whether the residual (True) or transfered risk (False) is retained when doing
98-
the risk transfer. Defaults to False.
98+
A boolean stating whether the residual (True) or transfered risk (False) is
99+
retained when applying a global risk transfer. Defaults to False.
99100
measure: Measure, optional
100101
The measure to apply to both snapshots. Defaults to None.
101102

0 commit comments

Comments
 (0)