Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Gauss–Newton algorithm

From Wikipedia, the free encyclopedia
Mathematical algorithm
Fitting of a noisy curve by an asymmetrical peak modelfβ(x){\displaystyle f_{\beta }(x)} with parametersβ{\displaystyle \beta } by mimimizing the sum of squared residualsri(β)=yifβ(xi){\displaystyle r_{i}(\beta )=y_{i}-f_{\beta }(x_{i})} at grid pointsxi{\displaystyle x_{i}}, using the Gauss–Newton algorithm.
Top: Raw data and model.
Bottom: Evolution of the normalised sum of the squares of the errors.

TheGauss–Newton algorithm is used to solvenon-linear least squares problems, which is equivalent to minimizing a sum of squared function values. It is an extension ofNewton's method for finding aminimum of a non-linearfunction. Since a sum of squares must be nonnegative, the algorithm can be viewed as using Newton's method to iteratively approximatezeroes of the components of the sum, and thus minimizing the sum. In this sense, the algorithm is also an effective method forsolving overdetermined systems of equations. It has the advantage that second derivatives, which can be challenging to compute, are not required.[1]

Non-linear least squares problems arise, for instance, innon-linear regression, where parameters in a model are sought such that the model is in good agreement with available observations.

The method is named after the mathematiciansCarl Friedrich Gauss andIsaac Newton, and first appeared in Gauss's 1809 workTheoria motus corporum coelestium in sectionibus conicis solem ambientum.[2]

Description

[edit]

Givenm{\displaystyle m} functionsr=(r1,,rm){\displaystyle {\textbf {r}}=(r_{1},\ldots ,r_{m})} (often called residuals) ofn{\displaystyle n} variablesβ=(β1,βn),{\displaystyle {\boldsymbol {\beta }}=(\beta _{1},\ldots \beta _{n}),} withmn,{\displaystyle m\geq n,} the Gauss–Newton algorithmiteratively finds the value ofβ{\displaystyle \beta } that minimize the sum of squares[3]S(β)=i=1mri(β)2.{\displaystyle S({\boldsymbol {\beta }})=\sum _{i=1}^{m}r_{i}({\boldsymbol {\beta }})^{2}.}

Starting with an initial guessβ(0){\displaystyle {\boldsymbol {\beta }}^{(0)}} for the minimum, the method proceeds by the iterationsβ(s+1)=β(s)(JrTJr)1JrTr(β(s)),{\displaystyle {\boldsymbol {\beta }}^{(s+1)}={\boldsymbol {\beta }}^{(s)}-\left(\mathbf {J_{r}} ^{\operatorname {T} }\mathbf {J_{r}} \right)^{-1}\mathbf {J_{r}} ^{\operatorname {T} }\mathbf {r} \left({\boldsymbol {\beta }}^{(s)}\right),}

where, ifr andβ arecolumn vectors, the entries of theJacobian matrix are(Jr)ij=ri(β(s))βj,{\displaystyle \left(\mathbf {J_{r}} \right)_{ij}={\frac {\partial r_{i}\left({\boldsymbol {\beta }}^{(s)}\right)}{\partial \beta _{j}}},}

and the symbolT{\displaystyle ^{\operatorname {T} }} denotes thematrix transpose.

At each iteration, the updateΔ=β(s+1)β(s){\displaystyle \Delta ={\boldsymbol {\beta }}^{(s+1)}-{\boldsymbol {\beta }}^{(s)}} can be found by rearranging the previous equation in the following two steps:

With substitutionsA=JrTJr{\textstyle A=\mathbf {J_{r}} ^{\operatorname {T} }\mathbf {J_{r}} },b=JrTr(β(s)){\displaystyle \mathbf {b} =-\mathbf {J_{r}} ^{\operatorname {T} }\mathbf {r} \left({\boldsymbol {\beta }}^{(s)}\right)}, andx=Δ{\displaystyle \mathbf {x} =\Delta }, this turns into the conventional matrix equation of formAx=b{\displaystyle A\mathbf {x} =\mathbf {b} }, which can then be solved in a variety of methods (seeNotes).

Ifm =n, the iteration simplifies to

β(s+1)=β(s)(Jr)1r(β(s)),{\displaystyle {\boldsymbol {\beta }}^{(s+1)}={\boldsymbol {\beta }}^{(s)}-\left(\mathbf {J_{r}} \right)^{-1}\mathbf {r} \left({\boldsymbol {\beta }}^{(s)}\right),}

which is a direct generalization ofNewton's method in one dimension.

In data fitting, where the goal is to find the parametersβ{\displaystyle {\boldsymbol {\beta }}} such that a given model functionf(x,β){\displaystyle \mathbf {f} (\mathbf {x} ,{\boldsymbol {\beta }})} best fits some data points(xi,yi){\displaystyle (x_{i},y_{i})}, the functionsri{\displaystyle r_{i}}are theresiduals:ri(β)=yif(xi,β).{\displaystyle r_{i}({\boldsymbol {\beta }})=y_{i}-f\left(x_{i},{\boldsymbol {\beta }}\right).}

Then, the Gauss–Newton method can be expressed in terms of the JacobianJf=Jr{\displaystyle \mathbf {J_{f}} =-\mathbf {J_{r}} } of the functionf{\displaystyle \mathbf {f} } asβ(s+1)=β(s)+(JfTJf)1JfTr(β(s)).{\displaystyle {\boldsymbol {\beta }}^{(s+1)}={\boldsymbol {\beta }}^{(s)}+\left(\mathbf {J_{f}} ^{\operatorname {T} }\mathbf {J_{f}} \right)^{-1}\mathbf {J_{f}} ^{\operatorname {T} }\mathbf {r} \left({\boldsymbol {\beta }}^{(s)}\right).}

Note that(JfTJf)1JfT{\displaystyle \left(\mathbf {J_{f}} ^{\operatorname {T} }\mathbf {J_{f}} \right)^{-1}\mathbf {J_{f}} ^{\operatorname {T} }} is the leftpseudoinverse ofJf{\displaystyle \mathbf {J_{f}} }.

Notes

[edit]

The assumptionmn in the algorithm statement is necessary, as otherwise the matrixJrTJr{\displaystyle \mathbf {J_{r}} ^{T}\mathbf {J_{r}} } is not invertible and the normal equations cannot be solved (at least uniquely).

The Gauss–Newton algorithm can be derived bylinearly approximating the vector of functionsri. UsingTaylor's theorem, we can write at every iteration:r(β)r(β(s))+Jr(β(s))Δ{\displaystyle \mathbf {r} ({\boldsymbol {\beta }})\approx \mathbf {r} \left({\boldsymbol {\beta }}^{(s)}\right)+\mathbf {J_{r}} \left({\boldsymbol {\beta }}^{(s)}\right)\Delta }

withΔ=ββ(s){\displaystyle \Delta ={\boldsymbol {\beta }}-{\boldsymbol {\beta }}^{(s)}}. The task of findingΔ{\displaystyle \Delta } minimizing the sum of squares of the right-hand side; i.e.,minr(β(s))+Jr(β(s))Δ22,{\displaystyle \min \left\|\mathbf {r} \left({\boldsymbol {\beta }}^{(s)}\right)+\mathbf {J_{r}} \left({\boldsymbol {\beta }}^{(s)}\right)\Delta \right\|_{2}^{2},}

is alinear least-squares problem, which can be solved explicitly, yielding the normal equations in the algorithm.

The normal equations aren simultaneous linear equations in the unknown incrementsΔ{\displaystyle \Delta }. They may be solved in one step, usingCholesky decomposition, or, better, theQR factorization ofJr{\displaystyle \mathbf {J_{r}} }. For large systems, aniterative method, such as theconjugate gradient method, may be more efficient. If there is a linear dependence between columns ofJr, the iterations will fail, asJrTJr{\displaystyle \mathbf {J_{r}} ^{T}\mathbf {J_{r}} } becomes singular.

Whenr{\displaystyle \mathbf {r} } is complexr:CnC{\displaystyle \mathbf {r} :\mathbb {C} ^{n}\to \mathbb {C} } the conjugate form should be used:(Jr¯TJr)1Jr¯T{\displaystyle \left({\overline {\mathbf {J_{r}} }}^{\operatorname {T} }\mathbf {J_{r}} \right)^{-1}{\overline {\mathbf {J_{r}} }}^{\operatorname {T} }}.

Example

[edit]
Calculated curve obtained withβ^1=0.362{\displaystyle {\hat {\beta }}_{1}=0.362} andβ^2=0.556{\displaystyle {\hat {\beta }}_{2}=0.556} (in blue) versus the observed data (in red)

In this example, the Gauss–Newton algorithm will be used to fit a model to some data by minimizing the sum of squares of errors between the data and model's predictions.

In a biology experiment studying the relation between substrate concentration[S] and reaction rate in an enzyme-mediated reaction, the data in the following table were obtained.

i1234567
[S]0.0380.1940.4250.6261.2532.5003.740
Rate0.0500.1270.0940.21220.27290.26650.3317

It is desired to find a curve (model function) of the formrate=Vmax[S]KM+[S]{\displaystyle {\text{rate}}={\frac {V_{\text{max}}\cdot [S]}{K_{M}+[S]}}}

that fits best the data in the least-squares sense, with the parametersVmax{\displaystyle V_{\text{max}}} andKM{\displaystyle K_{M}} to be determined.

Denote byxi{\displaystyle x_{i}} andyi{\displaystyle y_{i}} the values of[S] andrate respectively, withi=1,,7{\displaystyle i=1,\dots ,7}. Letβ1=Vmax{\displaystyle \beta _{1}=V_{\text{max}}} andβ2=KM{\displaystyle \beta _{2}=K_{M}}. We will findβ1{\displaystyle \beta _{1}} andβ2{\displaystyle \beta _{2}} such that the sum of squares of the residualsri=yiβ1xiβ2+xi,(i=1,,7){\displaystyle r_{i}=y_{i}-{\frac {\beta _{1}x_{i}}{\beta _{2}+x_{i}}},\quad (i=1,\dots ,7)}

is minimized.

The JacobianJr{\displaystyle \mathbf {J_{r}} } of the vector of residualsri{\displaystyle r_{i}} with respect to the unknownsβj{\displaystyle \beta _{j}} is a7×2{\displaystyle 7\times 2} matrix with thei{\displaystyle i}-th row having the entriesriβ1=xiβ2+xi;riβ2=β1xi(β2+xi)2.{\displaystyle {\frac {\partial r_{i}}{\partial \beta _{1}}}=-{\frac {x_{i}}{\beta _{2}+x_{i}}};\quad {\frac {\partial r_{i}}{\partial \beta _{2}}}={\frac {\beta _{1}\cdot x_{i}}{\left(\beta _{2}+x_{i}\right)^{2}}}.}

Starting with the initial estimates ofβ1=0.9{\displaystyle \beta _{1}=0.9} andβ2=0.2{\displaystyle \beta _{2}=0.2}, after five iterations of the Gauss–Newton algorithm, the optimal valuesβ^1=0.362{\displaystyle {\hat {\beta }}_{1}=0.362} andβ^2=0.556{\displaystyle {\hat {\beta }}_{2}=0.556} are obtained. The sum of squares of residuals decreased from the initial value of 1.445 to 0.00784 after the fifth iteration. The plot in the figure on the right shows the curve determined by the model for the optimal parameters with the observed data.

Convergence properties

[edit]

The Gauss-Newton iteration is guaranteed to converge toward a local minimum pointβ^{\displaystyle {\hat {\beta }}} under 4 conditions:[4] The functionsr1,,rm{\displaystyle r_{1},\ldots ,r_{m}} are twice continuously differentiable in an open convex setDβ^{\displaystyle D\ni {\hat {\beta }}}, the JacobianJr(β^){\displaystyle \mathbf {J} _{\mathbf {r} }({\hat {\beta }})} is of full column rank, the initial iterateβ(0){\displaystyle \beta ^{(0)}} is nearβ^{\displaystyle {\hat {\beta }}}, and the local minimum value|S(β^)|{\displaystyle |S({\hat {\beta }})|} is small. The convergence is quadratic if|S(β^)|=0{\displaystyle |S({\hat {\beta }})|=0}.

It can be shown[5] that the increment Δ is adescent direction forS, and, if the algorithm converges, then the limit is astationary point ofS. For large minimum value|S(β^)|{\displaystyle |S({\hat {\beta }})|}, however, convergence is not guaranteed, not evenlocal convergence as inNewton's method, or convergence under the usual Wolfe conditions.[6]

The rate of convergence of the Gauss–Newton algorithm can approachquadratic.[7] The algorithm may converge slowly or not at all if the initial guess is far from the minimum or the matrixJrTJr{\displaystyle \mathbf {J_{r}^{\operatorname {T} }J_{r}} } isill-conditioned. For example, consider the problem withm=2{\displaystyle m=2} equations andn=1{\displaystyle n=1} variable, given byr1(β)=β+1,r2(β)=λβ2+β1.{\displaystyle {\begin{aligned}r_{1}(\beta )&=\beta +1,\\r_{2}(\beta )&=\lambda \beta ^{2}+\beta -1.\end{aligned}}}

Forλ<1{\displaystyle \lambda <1},β=0{\displaystyle \beta =0} is a local optimum. Ifλ=0{\displaystyle \lambda =0}, then the problem is in fact linear and the method finds the optimum in one iteration. If |λ| < 1, then the method converges linearly and the error decreases asymptotically with a factor |λ| at every iteration. However, if |λ| > 1, then the method does not even converge locally.[8]

Solving overdetermined systems of equations

[edit]

The Gauss-Newton iterationx(k+1)=x(k)J(x(k))f(x(k)),k=0,1,{\displaystyle \mathbf {x} ^{(k+1)}=\mathbf {x} ^{(k)}-J(\mathbf {x} ^{(k)})^{\dagger }\mathbf {f} (\mathbf {x} ^{(k)})\,,\quad k=0,1,\ldots }is an effective method for solvingoverdetermined systems of equations in the form off(x)=0{\displaystyle \mathbf {f} (\mathbf {x} )=\mathbf {0} } withf(x)=[f1(x1,,xn)fm(x1,,xn)]{\displaystyle \mathbf {f} (\mathbf {x} )={\begin{bmatrix}f_{1}(x_{1},\ldots ,x_{n})\\\vdots \\f_{m}(x_{1},\ldots ,x_{n})\end{bmatrix}}}andm>n{\displaystyle m>n} whereJ(x){\displaystyle J(\mathbf {x} )^{\dagger }} is theMoore-Penrose inverse (also known aspseudoinverse) of theJacobian matrixJ(x){\displaystyle J(\mathbf {x} )} off(x){\displaystyle \mathbf {f} (\mathbf {x} )}. It can be considered an extension ofNewton's method and enjoys the same local quadratic convergence[4] toward isolated regular solutions.

If the solution doesn't exist but the initial iteratex(0){\displaystyle \mathbf {x} ^{(0)}} is near a pointx^=(x^1,,x^n){\displaystyle {\hat {\mathbf {x} }}=({\hat {x}}_{1},\ldots ,{\hat {x}}_{n})} at which the sum of squaresi=1m|fi(x1,,xn)|2f(x)22{\textstyle \sum _{i=1}^{m}|f_{i}(x_{1},\ldots ,x_{n})|^{2}\equiv \|\mathbf {f} (\mathbf {x} )\|_{2}^{2}} reaches a small local minimum, the Gauss-Newton iteration linearly converges tox^{\displaystyle {\hat {\mathbf {x} }}}. The pointx^{\displaystyle {\hat {\mathbf {x} }}} is often called aleast squares solution of the overdetermined system.

Derivation from Newton's method

[edit]

In what follows, the Gauss–Newton algorithm will be derived fromNewton's method for function optimization via an approximation. As a consequence, the rate of convergence of the Gauss–Newton algorithm can be quadratic under certain regularity conditions. In general (under weaker conditions), the convergence rate is linear.[9]

The recurrence relation for Newton's method for minimizing a functionS of parametersβ{\displaystyle {\boldsymbol {\beta }}} isβ(s+1)=β(s)H1g,{\displaystyle {\boldsymbol {\beta }}^{(s+1)}={\boldsymbol {\beta }}^{(s)}-\mathbf {H} ^{-1}\mathbf {g} ,}

whereg denotes thegradient vector ofS, andH denotes theHessian matrix ofS.

SinceS=i=1mri2{\textstyle S=\sum _{i=1}^{m}r_{i}^{2}}, the gradient is given bygj=2i=1mririβj.{\displaystyle g_{j}=2\sum _{i=1}^{m}r_{i}{\frac {\partial r_{i}}{\partial \beta _{j}}}.}

Elements of the Hessian are calculated by differentiating the gradient elements,gj{\displaystyle g_{j}}, with respect toβk{\displaystyle \beta _{k}}:Hjk=2i=1m(riβjriβk+ri2riβjβk).{\displaystyle H_{jk}=2\sum _{i=1}^{m}\left({\frac {\partial r_{i}}{\partial \beta _{j}}}{\frac {\partial r_{i}}{\partial \beta _{k}}}+r_{i}{\frac {\partial ^{2}r_{i}}{\partial \beta _{j}\partial \beta _{k}}}\right).}

The Gauss–Newton method is obtained by ignoring the second-order derivative terms (the second term in this expression). That is, the Hessian is approximated byHjk2i=1mJijJik,{\displaystyle H_{jk}\approx 2\sum _{i=1}^{m}J_{ij}J_{ik},}

whereJij=ri/βj{\textstyle J_{ij}={\partial r_{i}}/{\partial \beta _{j}}} are entries of the JacobianJr. Note that when the exact hessian is evaluated near an exact fit we have near-zerori{\displaystyle r_{i}}, so the second term becomes near-zero as well, which justifies the approximation. The gradient and the approximate Hessian can be written in matrix notation asg=2JrTr,H2JrTJr.{\displaystyle \mathbf {g} =2{\mathbf {J} _{\mathbf {r} }}^{\operatorname {T} }\mathbf {r} ,\quad \mathbf {H} \approx 2{\mathbf {J} _{\mathbf {r} }}^{\operatorname {T} }\mathbf {J_{r}} .}

These expressions are substituted into the recurrence relation above to obtain the operational equationsβ(s+1)=β(s)+Δ;Δ=(JrTJr)1JrTr.{\displaystyle {\boldsymbol {\beta }}^{(s+1)}={\boldsymbol {\beta }}^{(s)}+\Delta ;\quad \Delta =-\left(\mathbf {J_{r}} ^{\operatorname {T} }\mathbf {J_{r}} \right)^{-1}\mathbf {J_{r}} ^{\operatorname {T} }\mathbf {r} .}

Convergence of the Gauss–Newton method is not guaranteed in all instances. The approximation|ri2riβjβk||riβjriβk|{\displaystyle \left|r_{i}{\frac {\partial ^{2}r_{i}}{\partial \beta _{j}\partial \beta _{k}}}\right|\ll \left|{\frac {\partial r_{i}}{\partial \beta _{j}}}{\frac {\partial r_{i}}{\partial \beta _{k}}}\right|}

that needs to hold to be able to ignore the second-order derivative terms may be valid in two cases, for which convergence is to be expected:[10]

  1. The function valuesri{\displaystyle r_{i}} are small in magnitude, at least around the minimum.
  2. The functions are only "mildly" nonlinear, so that2riβjβk{\textstyle {\frac {\partial ^{2}r_{i}}{\partial \beta _{j}\partial \beta _{k}}}} is relatively small in magnitude.

Improved versions

[edit]

With the Gauss–Newton method the sum of squares of the residualsS may not decrease at every iteration. However, since Δ is a descent direction, unlessS(βs){\displaystyle S\left({\boldsymbol {\beta }}^{s}\right)} is a stationary point, it holds thatS(βs+αΔ)<S(βs){\displaystyle S\left({\boldsymbol {\beta }}^{s}+\alpha \Delta \right)<S\left({\boldsymbol {\beta }}^{s}\right)} for all sufficiently smallα>0{\displaystyle \alpha >0}. Thus, if divergence occurs, one solution is to employ a fractionα{\displaystyle \alpha } of the increment vector Δ in the updating formula:βs+1=βs+αΔ.{\displaystyle {\boldsymbol {\beta }}^{s+1}={\boldsymbol {\beta }}^{s}+\alpha \Delta .}

In other words, the increment vector is too long, but it still points "downhill", so going just a part of the way will decrease the objective functionS. An optimal value forα{\displaystyle \alpha } can be found by using aline search algorithm, that is, the magnitude ofα{\displaystyle \alpha } is determined by finding the value that minimizesS, usually using adirect search method in the interval0<α<1{\displaystyle 0<\alpha <1} or abacktracking line search such asArmijo-line search. Typically,α{\displaystyle \alpha } should be chosen such that it satisfies theWolfe conditions or theGoldstein conditions.[11]

In cases where the direction of the shift vector is such that the optimal fraction α is close to zero, an alternative method for handling divergence is the use of theLevenberg–Marquardt algorithm, atrust region method.[3] The normal equations are modified in such a way that the increment vector is rotated towards the direction ofsteepest descent,(JTJ+λD)Δ=JTr,{\displaystyle \left(\mathbf {J^{\operatorname {T} }J+\lambda D} \right)\Delta =-\mathbf {J} ^{\operatorname {T} }\mathbf {r} ,}

whereD is a positive diagonal matrix. Note that whenD is the identity matrixI andλ+{\displaystyle \lambda \to +\infty }, thenλΔ=λ(JTJ+λI)1(JTr)=(IJTJ/λ+)(JTr)JTr{\displaystyle \lambda \Delta =\lambda \left(\mathbf {J^{\operatorname {T} }J} +\lambda \mathbf {I} \right)^{-1}\left(-\mathbf {J} ^{\operatorname {T} }\mathbf {r} \right)=\left(\mathbf {I} -\mathbf {J^{\operatorname {T} }J} /\lambda +\cdots \right)\left(-\mathbf {J} ^{\operatorname {T} }\mathbf {r} \right)\to -\mathbf {J} ^{\operatorname {T} }\mathbf {r} }, therefore thedirection of Δ approaches the direction of the negative gradientJTr{\displaystyle -\mathbf {J} ^{\operatorname {T} }\mathbf {r} }.

The so-called Marquardt parameterλ{\displaystyle \lambda } may also be optimized by a line search, but this is inefficient, as the shift vector must be recalculated every timeλ{\displaystyle \lambda } is changed. A more efficient strategy is this: When divergence occurs, increase the Marquardt parameter until there is a decrease inS. Then retain the value from one iteration to the next, but decrease it if possible until a cut-off value is reached, when the Marquardt parameter can be set to zero; the minimization ofS then becomes a standard Gauss–Newton minimization.

Large-scale optimization

[edit]

For large-scale optimization, the Gauss–Newton method is of special interest because it is often (though certainly not always) true that the matrixJr{\displaystyle \mathbf {J} _{\mathbf {r} }} is moresparse than the approximate HessianJrTJr{\displaystyle \mathbf {J} _{\mathbf {r} }^{\operatorname {T} }\mathbf {J_{r}} }. In such cases, the step calculation itself will typically need to be done with an approximate iterative method appropriate for large and sparse problems, such as theconjugate gradient method.

In order to make this kind of approach work, one needs at least an efficient method for computing the productJrTJrp{\displaystyle {\mathbf {J} _{\mathbf {r} }}^{\operatorname {T} }\mathbf {J_{r}} \mathbf {p} }

for some vectorp. Withsparse matrix storage, it is in general practical to store the rows ofJr{\displaystyle \mathbf {J} _{\mathbf {r} }} in a compressed form (e.g., without zero entries), making a direct computation of the above product tricky due to the transposition. However, if one definesci as rowi of the matrixJr{\displaystyle \mathbf {J} _{\mathbf {r} }}, the following simple relation holds:JrTJrp=ici(cip),{\displaystyle {\mathbf {J} _{\mathbf {r} }}^{\operatorname {T} }\mathbf {J_{r}} \mathbf {p} =\sum _{i}\mathbf {c} _{i}\left(\mathbf {c} _{i}\cdot \mathbf {p} \right),}

so that every row contributes additively and independently to the product. In addition to respecting a practical sparse storage structure, this expression is well suited forparallel computations. Note that every rowci is the gradient of the corresponding residualri; with this in mind, the formula above emphasizes the fact that residuals contribute to the problem independently of each other.

Related algorithms

[edit]

In aquasi-Newton method, such as that due toDavidon, Fletcher and Powell or Broyden–Fletcher–Goldfarb–Shanno (BFGS method) an estimate of the full Hessian2Sβjβk{\textstyle {\frac {\partial ^{2}S}{\partial \beta _{j}\partial \beta _{k}}}} is built up numerically using first derivativesriβj{\textstyle {\frac {\partial r_{i}}{\partial \beta _{j}}}} only so that aftern refinement cycles the method closely approximates to Newton's method in performance. Note that quasi-Newton methods can minimize general real-valued functions, whereas Gauss–Newton, Levenberg–Marquardt, etc. fits only to nonlinear least-squares problems.

Another method for solving minimization problems using only first derivatives isgradient descent. However, this method does not take into account the second derivatives even approximately. Consequently, it is highly inefficient for many functions, especially if the parameters have strong interactions.

Example implementations

[edit]

Julia

[edit]

The following implementation inJulia provides one method which uses a provided Jacobian and another computing withautomatic differentiation.

"""    gaussnewton(r, J, β₀, maxiter, tol)Perform Gauss–Newton optimization to minimize the residual function `r` with Jacobian `J` starting from `β₀`. The algorithm terminates when the norm of the step is less than `tol` or after `maxiter` iterations."""functiongaussnewton(r,J,β₀,maxiter,tol)β=copy(β₀)for_in1:maxiter=J(β);Δ=-('*)\('*r(β))β+=Δifsqrt(sum(abs2,Δ))<tolbreakendendreturnβendimportAbstractDifferentiationasAD,Zygotebackend=AD.ZygoteBackend()# other backends are available"""    gaussnewton(r, β₀, maxiter, tol)Perform Gauss–Newton optimization to minimize the residual function `r` starting from `β₀`. The relevant Jacobian is calculated using automatic differentiation. The algorithm terminates when the norm of the step is less than `tol` or after `maxiter` iterations."""functiongaussnewton(r,β₀,maxiter,tol)β=copy(β₀)for_in1:maxiter,=AD.value_and_jacobian(backend,r,β)Δ=-([1]'*[1])\([1]'*)β+=Δifsqrt(sum(abs2,Δ))<tolbreakendendreturnβend

Notes

[edit]
  1. ^Mittelhammer, Ron C.; Miller, Douglas J.; Judge, George G. (2000).Econometric Foundations. Cambridge: Cambridge University Press. pp. 197–198.ISBN 0-521-62394-4.
  2. ^Floudas, Christodoulos A.; Pardalos, Panos M. (2008).Encyclopedia of Optimization. Springer. p. 1130.ISBN 9780387747583.
  3. ^abBjörck (1996)
  4. ^abJ.E. Dennis, Jr. and R.B. Schnabel (1983).Numerical Methods for Unconstrained Optimization and Nonlinear Equations. SIAM 1996 reproduction of Prentice-Hall 1983 edition. p. 222.
  5. ^Björck (1996), p. 260.
  6. ^Mascarenhas (2013), "The divergence of the BFGS and Gauss Newton Methods",Mathematical Programming,147 (1):253–276,arXiv:1309.7922,doi:10.1007/s10107-013-0720-6,S2CID 14700106
  7. ^Björck (1996), p. 341, 342.
  8. ^Fletcher (1987), p. 113.
  9. ^"Archived copy"(PDF). Archived fromthe original(PDF) on 2016-08-04. Retrieved2014-04-25.{{cite web}}: CS1 maint: archived copy as title (link)
  10. ^Nocedal (1999), p. 259.
  11. ^Nocedal, Jorge. (1999).Numerical optimization. Wright, Stephen J., 1960-. New York: Springer.ISBN 0387227423.OCLC 54849297.

References

[edit]

External links

[edit]
  • Probability, Statistics and Estimation The algorithm is detailed and applied to the biology experiment discussed as an example in this article (page 84 with the uncertainties on the estimated values).

Implementations

[edit]
  • Artelys Knitro is a non-linear solver with an implementation of the Gauss–Newton method. It is written in C and has interfaces to C++/C#/Java/Python/MATLAB/R.
Publications
Other writings
Contributions
Newtonianism
Personal life
Relations
Depictions
Namesake
Categories
Computational statistics
Correlation and dependence
Regression analysis
Regression as a
statistical model
Linear regression
Predictor structure
Non-standard
Non-normal errors
Decomposition of variance
Model exploration
Background
Design of experiments
Numericalapproximation
Applications
Functions
Gradients
Convergence
Quasi–Newton
Other methods
Hessians
Graph of a strictly concave quadratic function with unique maximum.
Optimization computes maxima and minima.
General
Differentiable
Convex
minimization
Linear and
quadratic
Interior point
Basis-exchange
Paradigms
Graph
algorithms
Minimum
spanning tree
Shortest path
Network flows
Retrieved from "https://en.wikipedia.org/w/index.php?title=Gauss–Newton_algorithm&oldid=1295135960"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp