rdtools.filtering.directional_tukey_filter

rdtools.filtering.directional_tukey_filter(series, roll_period=Timedelta('7 days 00:00:00'), k=1.5)

Performs a forward and backward looking rolling Tukey filter. Points more than k*IQR above the third quartile or below the first quartile are classified as outliers. Points must only pass one of either the forward or backward looking filters to be kept. Designed for use after the aggregation step in the RdTools trend analysis workflows

Parameters:
  • series (pandas.Series) -- Pandas time series to be filtered.

  • roll_period (int or timedelta, default 7 days) -- The window to use for backward and forward rolling medians for detecting outliers.

  • k (float) -- The Tukey parameter. Points more than k*IQR above the third quartile or below the first quartile are classified as outliers.

Returns:

Boolean Series excluding anomalies

Return type:

pandas.Series