算法:有没有数据的线性趋势? [英] Algorithm: is there a linear trend in data?

查看:300
本文介绍了算法:有没有数据的线性趋势?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我具有由整数x = [X1,...,XN]的数组psented连续输入的数据重新$ P $,N。1 000 000每两个元件满足以下的条件×〔1] - ; ×〔1 + 1]。

I am having a continuously incoming data represented by an array of integer x = [x1,...,xn], n<1 000 000. Each two elements satisfy the following condition x[i] < x[i + 1].

我需要检测尽可能快这样的断点,其中这些数据端部的线性趋势并变换成二次趋势。数据总是以线性趋势...

I need to detected as fast as possible such a breakpoint, where the linear trend of these data ends and transforms into a quadratic trend. The data always starts with linear trend...

我试图来计算

k = (x[i+1] - x[i])/ (x[i] - x[i-1]) 

不过这个测试不是太可靠的...也许还有一个更简单和有效的统计检验......回归线的计算是在这种情况下慢...

but this test not too reliable... Maybe there is a more simple and efficent statistic test... The computation of the regression line is slow in this case...

感谢您的帮助......

Thanks for your help...

推荐答案

其实你计算函数的导数。也许你应该使用更多的点来计算它如5,看五点型板

Actually you calculate a derivative of the function. Possibly you should use more points for calculating it e.g. 5, see Five-point stencil

这篇关于算法:有没有数据的线性趋势?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆