且构网

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

如何检测时间序列数据中的显着变化/趋势?

更新时间:2023-02-26 19:55:30

正如已经指出的那样,您不是在寻找衍生物.您确实在寻找时间序列的重大变化"检测算法.

As has been pointed out already, you're not looking for the derivative. You're really looking for a "significant change" detection algorithm for a time series.

您肯定需要一个平滑过滤器(移动平均过滤器很好——请参阅 Bjorn 的回答)部分).

You'll certainly want a smoothing filter (and the moving average filter is fine -- see Bjorn's answer for this part).

但除了平滑过滤器之外,您还需要一个决策标准或阈值选择器,超过它您将决定过滤后的变化是否显着.

But in addition to the smoothing filter, you will also need a decision criteria or threshold selector beyond which you will decide whether or not the filtered changes are significant.

如果您的时间序列的基础统计数据是稳定的(平稳时间序列),那么您可以使用固定的统计阈值,即与平均值的标准偏差.例如,如果您想要一个相当强的警报"阈值,您可以选择 2 个标准差(认为仅对最强的 5% 回报发出警报).

If the underlying statistics of your time series is stable (stationary time series), then you can use a fixed statistical threshold, in the sense of standard deviations from the mean. For example, you might choose 2 standard deviations if you want a fairly strong "alarm" threshold (think alarming only on the strongest 5% of returns).

如果根本问题中没有任何内容表明您的时间序列是稳定的,即如果序列中可能有趋势,或者生成时间序列的基础过程可以在您监视它时发生根本性的变化,那么您需要使用动态或自适应阈值,就信噪比 (mu/sigma) 而言.然后,您可以选择检测通过信噪比测试的所有有意义"元素.

If there is nothing in the underlying problem that suggests that your time series is stable, i.e. if series could have a trend in it, or the underlying process generating the time series can go through fundmantal changes while you're monitoring it, then you'll need to use a dynamic, or adaptive threshold, in the sense of signal-to-noise (mu/sigma). You might then choose to detect all "meaningful" elements that pass the signal to noise test.