且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在线检测一般时间序列的异常值的简单算法

更新时间:2023-02-26 19:50:17

这是一个大而复杂的主题,答案取决于(a)您要为此付出多少努力,以及(b)您是否有效希望您能检测到异常值.一种可能的方法是自适应滤波,通常用于降噪耳机等应用.具有一个不断适应输入信号的滤波器,有效地使其滤波器系数与信号源的假设短期模型匹配,从而降低了均方误差输出.然后,当您出现异常值时,会为您提供低电平输出信号(残留误差) ,这会导致尖峰,并且很容易检测到(阈值).在自适应过滤

This is a big and complex subject, and the answer will depend on (a) how much effort you want to invest in this and (b) how effective you want your outlier detection to be. One possible approach is adaptive filtering, which is typically used for applications like noise cancelling headphones, etc. You have a filter which constantly adapts to the input signal, effectively matching its filter coefficients to a hypothetical short term model of the signal source, thereby reducing mean square error output. This then gives you a low level output signal (the residual error) except for when you get an outlier, which will result in a spike, which will be easy to detect (threshold). Read up on adaptive filtering, LMS filters, etc, if you're serious about this kind of technique.