我有一系列时间序列数据
delay(10)
espData=[value,100,1513298528793]
delay(10)
espData=[value,110,1513298528803]
delay(10)
espData=[value,120,1513298528813]
delay(10)
espData=[value,130,1513298528823]
delay(10)
espData=[value,140,1513298528833]
我想知道线性回归中的天气斜率计算将帮助我找到百分比变化(负/正)
答案 0 :(得分:0)
用户sequence processing in Siddhi
以下代码将执行
define stream InputStream (vlaue int, timestamp long);
from every e1 = InputStream, e2 = InputStream
select (e2.vlaue - e1.vlaue) * 100.0/e1.vlaue as percentageChange,
e1.vlaue as oldVaule, e2.vlaue as newValue
insert into OutputStream;