General Polynomial Fit (Not in Base Package)

Finds the polynomial curve values and the set of Polynomial Fit Coefficients, which describe the polynomial curve that best represents the input data set. Details

The number of sample points in Y Values must be greater than polynomial order. If the number of sample points is less than or equal to polynomial order, the VI sets Polynomial Fit Coefficients to an empty array and returns an error.
The number of sample points in X Values must be greater than polynomial order. If the number of sample points is less than or equal to polynomial order, the VI sets Polynomial Fit Coefficients to an empty array and returns an error.
polynomial order must be greater than or equal to zero. If polynomial order is less than zero, the VI sets Polynomial Fit Coefficients to an empty array and returns an error. The default is 2.

0 m < n-1

where n is the number of sample points and m is the polynomial order.

algorithm specifies the algorithm the VI uses to compute Best Fit.

0SVD (default)
1Givens
2Givens2
3Householder
4LU decomposition
5Cholesky
Best Polynomial Fit is the polynomial curve values that best represent the input data set.
The total number of elements in Polynomial Fit Coefficients is m + 1, where m is the polynomial order.
mse is the mean squared error.
error returns any error or warning condition from the VI.

General Polynomial Fit Details

Example

The general form of the polynomial fit is given by

where F represents the output sequence Best Polynomial Fit, X represents the input sequence X Values, a represents the Polynomial Fit Coefficients, and m is the polynomial order.

The VI obtains mse using the formula

where Y represents the input sequence Y Values, and n is the number of data points.

General Polynomial Fit is a special case of the General LS Linear Fit. The General Polynomial Fit VI uses the General LS Linear Fit VI as a subVI. This VI builds the H matrix internally using input X Values for the General LS Linear Fit VI.

The formula used to build H is as follows: