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)
387
+
388
+
This method returns the components of the change in risk at each date:
389
+
390
+
- The base risk, i.e., the risk without change in hazard or exposure, compared to trajectory earliest date.
391
+
- The "delta from exposure", i.e., the additional risks that come with change in exposure
392
+
- The "delta from hazard", i.e., the additional risks that come with change in hazard
393
+
394
+
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.
395
+
396
+
Parameters
397
+
----------
398
+
npv : bool
399
+
Whether to apply the (risk) discount rate if it is defined.
400
+
Defaults to `True`.
401
+
402
+
"""
403
+
302
404
returnself._compute_metrics(
303
405
npv=npv,
304
406
metric_name="risk_components",
@@ -312,6 +414,30 @@ def per_date_risk_metrics(
312
414
return_periods: list[int] |None=None,
313
415
npv: bool=True,
314
416
) ->pd.DataFrame|pd.Series:
417
+
"""Returns a DataFrame of risk metrics for each dates
418
+
419
+
This methods collects (and if needed computes) the `metrics`
420
+
(Defaulting to "aai", "return_periods" and "aai_per_group").
421
+
422
+
Parameters
423
+
----------
424
+
metrics : list[str], optional
425
+
The list of metrics to return (defaults to
426
+
["aai","return_periods","aai_per_group"])
427
+
return_periods : list[int], optional
428
+
The return periods to consider for the return periods metric
429
+
(default to the value of the `.default_rp` attribute)
430
+
npv : bool
431
+
Whether to apply the (risk) discount rate if it was defined
432
+
when instantiating the trajectory. Defaults to `True`.
433
+
434
+
Returns
435
+
-------
436
+
pd.DataFrame | pd.Series
437
+
A tidy DataFrame with metrics value for all possible dates.
0 commit comments