Next: , Previous: , Up: Nonlinear Least-Squares Fitting   [Index]


39.2 Weighted Nonlinear Least-Squares

Weighted nonlinear least-squares fitting minimizes the function where W = diag(w_1,w_2,...,w_n) is the weighting matrix, and the weights w_i are commonly defined as w_i = 1/\sigma_i^2, where \sigma_i is the error in the ith measurement. A simple change of variables \tilde{f} = \sqrt{W} f yields \Phi(x) = {1 \over 2} ||\tilde{f}||^2, which is in the same form as the unweighted case. The user can either perform this transform directly on their function residuals and Jacobian, or use the gsl_multifit_fdfsolver_wset interface which automatically performs the correct scaling. To manually perform this transformation, the residuals and Jacobian should be modified according to where Y_i = Y(x,t_i).