Outlier detection library consolidation
For the workshop i would like to have a basic and good-to-generalize, one dimensional outlier detection in place. This is the simple flagging of a variables Z-Score.
-
In Addition with customization arguments for the central-moment function and the scaling function, it is added as
flagZScoreto the outlier detection library. -
It is the algorithm, of which
flagMADis a special case, so i madeflagMADwrap around it. (Thats why flagging the MAD normalized scores is usually called modified Z score - but i guess renamings cause to much a backwards compatibilty huzzle right now)
I added a useful feature that adds a condition for the residuals (controlled by thresh_residual parameter) and mitigates the overflagging, flagMAD and flagZscore suffer from, when using small windows.