qis.filter_outliers

qis.filter_outliers(data, outlier_policy)[source]

Remove outliers by the cuts of an OutlierPolicy, applied in a fixed order.

The order is: absolute ceiling and floor; the optional log transform; a cut at the full-sample mean plus std_abs_ceil (or std_abs_floor) full-sample standard deviations; a cut of the contemporaneous EWM score of the cleaned data at std_ewm_ceil and std_ewm_floor; the inverse log. Rejected points become NaN, or the EWM mean with ReplacementType.EWMA_MEAN. Invalid-value warnings are silenced for the duration of the call only. The cuts use the whole sample: descriptive cleaning, not a backtest path.

Parameters:
Returns:

the cleaned data, same container as data

Raises:

TypeError – for an unsupported container, or a log transform without abs_floor

Return type:

DataFrame | Series | ndarray