Siddhi enables users to forecast future events using linear regression on real time, data streams. The forecast function takes in a Y event stream, an X event stream and a user specified next X value, and returns the forecast Y value based on the regression equation that fits the data received.
The frequency of regression calculation.
Default value: 1 (i.e. at every event)
The maximum number of events used for a regression calculation
Default value: 1,000,000 events
Confidence Interval to be used for regression calculation
Default value: 0.95
Next X Value
Value to be used to forecast the Y value. This can be a constant, or an expression (eg:- x+5)
Data stream of the dependent variable
Data stream of the independent variable
Forecast Y value based on next X and regression equation.
Standard Error of the Regression Equation
β coefficients of the simple linear regression
Input Stream Data
Name given in the input stream
All items sent in the input stream
The following query submits a calculation interval (every 10 events), a batch size (100,000 evetns) a confidence interval (0.95) a dependent input stream (Y) and 3 independent input streams (X1, X2, X3) that will be used to perform linear regression between Y and all X streams.
from StockExchangeStream#transform.timeseries:forecast(X+5, Y, X)
insert into StockForecaster
When executed, the above query will return the forecast Y value based on the regression equation established using the Y stream and the X stream and the standard error of the regression equation (ε), β coefficients and all the items available in the input stream.