---
title: Linear Prediction
slug: manufacturing-connect-edge-v2/linear-prediction
docTags: 
createdAt: 2024-08-08T21:48:27.618Z
---

The **Linear Prediction** processor forecast future data points by fitting a linear equation to collected data and using statistical techniques to identify the underlying trend.

# Linear Prediction Overview

- Once window values are full, the mean of values is subtracted from each element and squared (Y\_i - Mean\_Y)
- Same is done for the time series elements (X\_i - Mean\_X)
- The sum of squares is sum of (X\_i - Mean\_X)^2
- The sum of products is sum of (Y\_i - Mean\_Y) \* (X\_i - Mean\_X)
- The slope is obtained by the formula m = \{ Sum of products } / \{ Sum of Squares }
- The intercept is obtained by the formula b = Mean\_Y - m \* Mean\_X
- Finally, prediction is made by extrapolating the number of predictions in the simple formula y = m\*X + b
- Residual Error is obtained by modeling for current value, and subtracting the ACTUAL current value.
- The **timer interval** parameter is useful if the connected input tag is currently not polling, but you still want this KPI to publish a value every few seconds, defined by the aforementioned timer.
  - If you know your input is going to publish at the expected interval, it is better to disable this timer by entering **0** in the field.

# Linear Prediction Parameters

| **Parameters**        | **Details**                                                                                                                                                                                               |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Window Size           | This parameter determines how many values the processor should observe before making each prediction.                                                                                                     |
| Number of Predictions | This parameter specifies how many polling intervals into the future the processor should predict.                                                                                                         |
| Polling Interval      | This parameter defines the time interval, in seconds, between successive data polling or data collection.                                                                                                 |
| Timer Interval        | If no event is detected, this timer interval is used to keep displaying the output continually. Entering zero disables this timer, and the prediction model relies entirely on incoming data for updates. |

![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/llI7m-ftosNIPRThFd1Oz_image.png "Linear Prediction parameters")

:::hint{type="info"}
**Note:&#x20;**&#x57;hen creating an analytics flow with *Linear Prediction&#x20;*&#x70;rocessor, refer the [Use the Linear Prediction Function](docId:3djzqsdS4EfrZ8HoQnEsi) guide for more details.
:::

