Linear Regression Fitting

Linear Regression Fitting 1:

The Linear Regression Fitting function block approximates one variable (the Dependent input) by linear combination of several other variables (Input 01 ... Input 0n). This is done by the incremental stochastic gradient method. At the end of the analysis, the calculated coefficients are written to a file.

The linear combination is given by the following equation:

Linear Regression Fitting 2:

In each cycle, the values for Linear Regression Fitting 3: to Linear Regression Fitting 4: are recalculated using the following rule:

Linear Regression Fitting 5:

This corresponds to the minimization of the squared deviation of the calculated values y (output by the function block as result) from the corresponding input value Dependent. The parameter Linear Regression Fitting 6:corresponds to the step size and specifies how strongly the parameters are adjusted. The larger the value, the faster the coefficients approach a local optimum. However, if the value is too large, the algorithm may not converge.

Typically, the Linear Regression Fitting function block is first used to fit the weights for the regression of a target variable. Then, using the Linear Regression Inference function block and the fitted weights, the target variable can be predicted based on the input variables.

Optionally, a Boolean signal can be selected for the Enable Execution input so that the algorithm is only active if the value of the selected signal is TRUE.

Configuration options

Output values

Standard HMI Controls

For the Linear Regression Fitting algorithm, the following HMI controls are available for generating an Analytics Dashboard:

1. The Linear Regression Control visualizes the inputs and the calculated regression line. The buttons can be used to select the input channel to be displayed on the x axis. The y axis shows the target values of the regression. A new point is outlined in red, old points gradually fade.

Linear Regression Fitting 7:

2. The Table Control or Multivalue Control visualizes all output values: MSE, result, output coefficients.

Linear Regression Fitting 8:
Linear Regression Fitting 9:
Linear Regression Fitting 10:

Alternatively, customer-specific HMI controls can be mapped in the Linear Regression Curve Fitting algorithm using the Mapping Wizard.