Linear Prediction
3 min
the linear prediction processor forecasts future values by fitting a linear trend line to a window of collected data using least squares regression why use linear prediction use this processor to project where a value is headed based on its recent trend, for example, predicting when a slowly rising temperature or pressure reading will cross a threshold how it works the processor fits a line to the values in the window using least squares regression it calculates the slope as sum((yᵢ meany)(xᵢ meanx)) / sum((xᵢ meanx)²) and the intercept as meany slope × meanx it then extrapolates the resulting line, y = slope × x + intercept , forward by the number of predictions you configure the processor also reports a residual error the difference between what the model predicted for the current value and the value that actually occurred if your input tag doesn't publish at a steady rate, use timer interval to publish a value on a fixed schedule instead of waiting for the next incoming event if your input already publishes at the interval you expect, enter 0 to disable the timer parameters parameter details window size how many values the processor observes before making each prediction number of predictions how many polling intervals into the future the processor predicts polling interval the time interval (in seconds) between successive data polls timer interval sets a timer (in milliseconds) that continuously publishes the output when no event triggers a prediction enter 0 to disable the timer; the prediction model then relies entirely on incoming data for updates pass through value determines whether the processor's output is the predicted value or the original unchanged input value related topics use the linear prediction function docid\ fk abv9b ppn3l2d9n0ik