Page History
Siddhi enables users to forecast future events using linear regression on real time, data streams. The forecast function takes in a Y dependent event stream (Y), an X independent event stream (X) and a user specified next X value, and returns the forecast Y value based on the regression equation that fits of the historical data received.
Input ParametersInputs
Parameter |
| Description |
Calculation Interval | Optional | The frequency of regression calculation. Default value: 1 (i.e. at every event) |
Batch Size | Optional | The maximum number of events used for a regression calculation Default value: 1,000,000,000 events |
Confidence Interval | Optional | Confidence Interval to be used for regression calculation Default value: 0.95 |
Next X Value | Required | Value to be used to forecast the Y value. This can be a constant, or an expression (eg:- x+5) |
Y Stream | Required | Data stream of the dependent variable |
X Stream | Required | Data stream of the independent variable |
Outputs
Output Parameters
Parameter | Name | Description |
Forecast Y | forecastY | Forecast Y value based on next X and regression equation. |
Standard Error | stdError | Standard Error of the Regression Equation |
β coefficients | beta0, beta1 | β coefficients of the simple linear regression |
Input Stream Data | Name given in the input stream | All items sent in the input stream |
ExamplesExample
The following query submits an expression to be used as the next X value (X+2) 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.
...