Standard Library function that uses the singular value decomposition method ofleast-squares curve fitting to fit a polynomial function to 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.
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: