Iteratively excludes values whose EWMA deviation exceeds an interval-specific threshold (ET cap). Each round removes the single worst outlier (largest |dewma|, with age then internal_id as tiebreakers). Iterates until no candidates remain or <3 values.
Usage
remove_ewma_wt(
subj_df,
wtallow_formula = "piecewise",
exc_label = "Exclude-A-Traj-Extreme",
ewma_window = 15
)Details
Threshold: ET cap derived from wtallow formula and upper weight (UW). Per-observation threshold based on min neighbor gap and max(wt, ewma).
90% rule: directional dewma (before/after) must exceed 90% of threshold. For edge values, the missing directional EWMA falls back to the overall EWMA, so the 90% rule does not block exclusion; a missing neighbor gap is treated as Inf when choosing the interval.
