The SVDFIT function performs a general least squares fit with optional error estimates and returns a vector of coefficients. Either a user-supplied function written in the IDL language or a built-in polynomial can be used to fit the data.
SVDFIT is based on the routine
described in section 15.4 of
Numerical Recipes in C: The Art of Scientific Computing
(Second Edition), published by Cambridge University Press, and is used by permission.
The number of coefficients in the fitting function. For polynomials, M is equal to the degree of the polynomial + 1. If the M argument is not specified, you must supply initial coefficient estimates using the A keyword. In this case, M is set equal to the number of elements of the array specified by the A keyword.
Set this keyword equal to a vector of initial estimates for the fitted function parameters. SVDFIT returns a vector of coefficients that are improvements of the initial estimates. If A is supplied, the M argument will be set equal to the number of elements in the vector specified by A.
Set this keyword equal to a string containing the name of a user-supplied IDL basis function with
coefficients. If this keyword is omitted, and the LEGENDRE keyword is not set, IDL assumes that the IDL procedure SVDFUNCT, found in the file
, located in the
subdirectory of the IDL distribution, is to be used. SVDFUNCT uses the basis functions for the fitting polynomial
The function to be fit must be written as an IDL function and compiled prior to calling SVDFIT. The function must accept values of X (a scalar), and M (a scalar). It must return an M -element vector containing the basis functions.
Set this keyword to use Legendre polynomials instead of the function specified by the FUNCTION_NAME keyword. If the LEGENDRE keyword is set, the IDL uses the function SVDLEG found in the file
, located in the
subdirectory of the IDL distribution.
Set this keyword equal to a vector of weights for Y i . This vector should be the same length as X and Y . The error for each term is weighted by WEIGHTS i when computing the fit. Frequently, WEIGHTS i = 1.0/s 2 i , where s is the measurement error or standard deviation of Y i (Gaussian or instrumental weighting), or WEIGHTS = 1/Y (Poisson or statistical weighting). If WEIGHTS is not specified, WEIGHTS i is assumed to be 1.0.