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(orstd_abs_floor) full-sample standard deviations; a cut of the contemporaneous EWM score of the cleaned data atstd_ewm_ceilandstd_ewm_floor; the inverse log. Rejected points become NaN, or the EWM mean withReplacementType.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:
data (DataFrame | Series | ndarray) – observations, time along the first axis
outlier_policy (OutlierPolicy) – the cuts; see
OutlierPolicyTypesfor presets
- Returns:
the cleaned data, same container as
data- Raises:
TypeError – for an unsupported container, or a log transform without
abs_floor- Return type: