## File: Nonlinear-Least_002dSquares-Weighted-Overview.html

package info (click to toggle)
gsl-ref-html 2.3-1
• area: non-free
• in suites: bullseye, buster, sid
• size: 6,876 kB
• ctags: 4,574
• sloc: makefile: 35
 file content (104 lines) | stat: -rw-r--r-- 5,298 bytes parent folder | download
 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104  GNU Scientific Library – Reference Manual: Nonlinear Least-Squares Weighted Overview

39.3 Weighted Nonlinear Least-Squares

Weighted nonlinear least-squares fitting minimizes the function

\Phi(x) = (1/2) || f(x) ||_W^2         = (1/2) \sum_{i=1}^{n} f_i(x_1, ..., x_p)^2

where W = diag(w_1,w_2,...,w_n) is the weighting matrix, and ||f||_W^2 = f^T W f. 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} = W^{1 \over 2} 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_nlinear_winit interface which automatically performs the correct scaling. To manually perform this transformation, the residuals and Jacobian should be modified according to

f~_i = f_i / \sigma_i J~_ij = 1 / \sigma_i df_i/dx_j

For large systems, the user must perform their own weighting.