Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Linear Fit PtByPt (Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Finds the line values and the coefficients slope and intercept, using the least-squares solution, that describe the line that best represents the set of input data points specified by sample length.

This VI is similar to the Linear Fit VI.

Details  

initialize, when TRUE, initializes the internal state of the VI.
y is an input data point.
x is an input data point.
sample length is the length of each set of incoming data. The VI performs computation for each set of data. The default is 100. When you set sample length to zero, the VI calculates a cumulative solution for the input data from the time that you called or initialized the VI. When the sample length setting is greater than zero, the VI calculates the solution for only the newest set of input data.
Best Linear Fit returns the y-values of the fitted model.
slope returns the slope of the fitted model.
intercept returns the intercept of the fitted model.
mse is the mean squared error.
error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

Linear Fit PtByPt Details

The general form of the output is

F = mX + b,

where F is the set of output data Best Linear Fit, X is x, m is the slope, b is the intercept.

The MSE between the output Best Linear Fit and y is computed using the MSE PtByPt VI and returned in mse, as shown in the following equation.

where n is the number of elements in the set of input data, f is Best Linear Fit, and y is y.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit