Calculates resilience indices (see Matzinger et al. 2018) for each failure event in time series of performance P(t). Failure is defined by acceptable performance Pa and maximal failure Pmax.

resilience.events(time_stamp, Pt, Pa, Pmax, evtSepTime, signalWidth)

Arguments

time_stamp

vector containing timestamp (sorted in ascending order)

Pt

vector with performance P(t) (same length as timestamp)

Pa

accpetable performance

Pmax

maximal failure

evtSepTime

"event separation time" in seconds. Maximal allowed time difference between two consecutive timestamps within the same event.

signalWidth

"signal width" in seconds. Length of time interval that one timestamp is representing, e.g. 5*60 = 300 if each timestamp respresents a time interval of five minutes (as e.g. a time series is recorded on a five minute time scale). This parameter is needed to calculate event durations.

Value

Returns data.frame containing one row by failure event. First columns are identical to kwb.event::hsEvents. Following columns are additional resilience indices:

  • Sev: severity by event

  • Res0: resilience index by event

  • trec: recovery time in seconds

  • trec_percent: trec relative to event duration in per cent

  • worst_P: P(t) closest to Pmax within event

script is stopped if no failure event with message "Pa never exceeded"