qf_lib.common.utils.returns.tail_events.tail_events(benchmark_tms: QFSeries, examined_tms: QFSeries, tail_percentile: float) [<class 'qf_lib.containers.series.qf_series.QFSeries'>, <class 'qf_lib.containers.series.qf_series.QFSeries'>][source]

Gets tail events of the benchmark and corresponding events in the examined timeseries. Both benchmark_tms and examined_tms must be of the same length. Moreover, events on each position in both series must be corresponding.

Example: for the tail_percentile = 16 all the events of the benchmark with values to the left from one standard deviation will be returned (along with corresponding events from examined_tms).

  • benchmark_tms (QFSeries) – timeseries corresponding to the benchmark

  • examined_tms (QFSeries) – timeseries corresponding to the examined asset

  • tail_percentile (float) – Percentile to compute. Must be a number from range [0,100]


(benchmark_tail_tms, examined_tail_tms) - tail events of the benchmark, events from the examined series corresponding to the benchmark’s tail events

Return type:

Tuple[QFSeries, QFSeries]