pyhctsa.operations.extreme_events.moving_threshold

pyhctsa.operations.extreme_events.moving_threshold(y, a=1.0, b=0.1)

Moving threshold model for extreme events in a time series.

Inspired by an idea contained in Altmann et al. (2006) [1].

This algorithm uses the occurrence of extreme events to modify a hypothetical ‘barrier’ that classifies new points as ‘extreme’ or not. The barrier begins at sigma (standard deviation), and if the absolute value of the next data point is greater than the barrier, the barrier is moved to (1+a) times that absolute value (above the new observation), otherwise the position of the barrier is decreased by a proportion ‘b’.

References

Parameters:
y : array-like

The input time series (should be z-scored).

a : float, optional

The barrier jump parameter: after an extreme event the barrier is set to (1+a) times the absolute value of the data point. Default is 1.0.

b : float, optional

The barrier decay proportion (0-1) - how much to decrease barrier otherwise. Default is 0.1.

Returns:

Dictionary containing barrier and kick statistics, including pkick (the probability of a kick, number of kicks / (N-1)) and meankicksize (the mean size of the barrier jump when a kick occurs; NaN if there are none).

Return type:

dict