You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Return the "components" of change in future risk (Exposure and Hazard)
380
+
381
+
This method returns the components of the change in risk at each date:
382
+
383
+
- The base risk, i.e., the risk without change in hazard or exposure, compared to trajectory earliest date.
384
+
- The "delta from exposure", i.e., the additional risks that come with change in exposure
385
+
- The "delta from hazard", i.e., the additional risks that come with change in hazard
386
+
387
+
Due to how computations are being done the "delta from exposure" corresponds to the change of risk due to change in exposure while hazard remains constant to "baseline hazard", while "delta from hazard" corresponds to the change of risk due to change in hazard, while exposure remains constant to **future** exposure.
388
+
389
+
Parameters
390
+
----------
391
+
npv : bool
392
+
Whether to apply the (risk) discount rate if it is defined.
393
+
Defaults to `True`.
394
+
395
+
"""
396
+
302
397
returnself._compute_metrics(
303
398
npv=npv,
304
399
metric_name="risk_components",
@@ -312,6 +407,30 @@ def per_date_risk_metrics(
312
407
return_periods: list[int] |None=None,
313
408
npv: bool=True,
314
409
) ->pd.DataFrame|pd.Series:
410
+
"""Returns a DataFrame of risk metrics for each dates
411
+
412
+
This methods collects (and if needed computes) the `metrics`
413
+
(Defaulting to "aai", "return_periods" and "aai_per_group").
414
+
415
+
Parameters
416
+
----------
417
+
metrics : list[str], optional
418
+
The list of metrics to return (defaults to
419
+
["aai","return_periods","aai_per_group"])
420
+
return_periods : list[int], optional
421
+
The return periods to consider for the return periods metric
422
+
(default to the value of the `.default_rp` attribute)
423
+
npv : bool
424
+
Whether to apply the (risk) discount rate if it was defined
425
+
when instantiating the trajectory. Defaults to `True`.
426
+
427
+
Returns
428
+
-------
429
+
pd.DataFrame | pd.Series
430
+
A tidy DataFrame with metrics value for all possible dates.
0 commit comments