Curve Fitting
- Updated2025-07-30
- 5 minute(s) read
Computes the coefficients that best represent the input data based on the chosen model type.

Dialog Box Options
| Option | Description |
|---|---|
| Model Type | Displays the data and results according to a mathematical model type you specify.
The model type can be any of the following options:
|
| results | Displays values generated for the parameters based on the options you select and values you enter. |
| Data Graph | Displays the original data and the best fit. The VI calculates best fit using the following equation. zi = f(xi)A where A is the best fit coefficient. |
| Residue Graph | Displays the difference between the original data and the best fit. |
Inputs/Outputs
error in (no error)
—
Describes error conditions that occur before this node runs.
Signals
—
Specifies the observed values of the dependent variable.
Locations
—
Specifies the values of the independent variables.
best fit
—
Returns the fitted data. The VI calculates best fit using the following equation. zi = f(xi)A where A is the best fit coefficient.
slope
—
Returns the slope of the calculated best linear fit.
a0
—
Returns the constant term of the calculated best quadratic fit.
a2
—
Returns the coefficient of the second-order term.
spline interpolant
—
Returns the second derivative of interpolating function g(x). spline interpolant is the second derivative of interpolating function g(x) at points ξ, i = 0, 1,…, n – 1.
non-linear coefficients
—
Returns the set of coefficients of the nonlinear model that best represents the input data set in the least-squares sense.
mean squared error
—
Returns the mean square error of the best fit.
intercept
—
Returns the intercept of the calculated best linear fit.
polynomial coefficients
—
Returns the coefficients that describe the best polynomial fit. The total number of elements in polynomial coefficients is m + 1, where m is Polynomial order.
error out
—
Contains error information. This output provides standard error out functionality.
a1
—
Returns the coefficient of the first-order term.
general LS coefficients
—
Returns the set of coefficients that best represent the input data set in the least-squares sense.
residual
—
Returns the difference between the original data and the best fit. |

error in (no error)
—
Signals
—
best fit
—
error out
—