Standard Library function that uses the singular value decomposition method ofleast-squares curve fitting to fit a polynomial function to data.
A vector containing the independent x-coordinates of the data.y
A vector containing the dependent y-coordinates of the data. This vector should have the same number of elements as x.m
The number of coefficients in the fitted function. For polynomials, m is one more than the degree of the polynomial.
A vector containing the coefficients of the polynomial equation which best approximates the data. It has a length of m.
The sum of the squared errors, multiplied by the weights, if Weight is specified.Covar
The covariance matrix of the m coefficients. Funct
The name of a user-supplied basis function with m coefficients (see User-Supplied Basis Function).Singular
The number of singular values (i.e., the number of values that are inconsistent with the other data) encountered in evaluating the fit. Should be 0; if not, the computed polynomials probably do not accurately reflect the data.Variance
The estimated variance (sigma squared) for each of the m coefficients.Weight
A vector of weighting factors for determining the weighting of the least-squares fit. Must have the same number of elements as x.Yfit
A vector containing the calculated y values of the fitted function.
yf = 1
c = SVDFIT(x, y, m, Yfit=yf)
The file containing Funct should reside in the current working directory or in the search path defined by the system variable !Path.
If Funct does not have the file extension .
pro, it should be compiled before it is called in SVDFIT.See the Standard Library function
cosines.pro, which defines a basis function of the form:

