POLYFITW function performs a weighted
fit with optional error estimates and returns a vector of coefficients with a length of
The POLYFITW routine uses matrix inversion. A newer version of this routine, SVDFIT, uses Singular Value Decomposition. The SVD technique is more flexible, but slower. Another version of this routine, POLY_FIT, performs a least square fit without weighting.
This routine is written in the IDL language. Its source code can be found in the file
subdirectory of the IDL distribution.
Result = POLYFITW(
X, Y, Weights, NDegree [,Yfit, Yband, Sigma, Corrm]
-element vector of independent variables.
A vector of independent variables, the same length as
A vector of weights, the same length as
The degree of the polynomial to fit.
A named variable that will contain the vector of calculated
values. These values have an error of plus or minus
A named variable that will contain the error estimate for each point.
A named variable that will contain the standard deviation of the returned coefficients.
A named variable that will contain the correlation matrix of the coefficients.