Levenberg-Marquardt

The previous sections introduced two fundamental approaches to nonlinear optimization: gradient descent and the Gauss-Newton method. For a more detailed discussion, see (MBT04).

The Gauss-Newton method uses a local linearization of the problem and generally converges very quickly near the solution. However, the matrix $\mathbf{J}_r^\top \mathbf{J}_r$ can be ill-conditioned or nearly singular, leading to numerical instability and excessively aggressive update steps.

The Levenberg-Marquardt (LM) algorithm introduces a regularization term that combines the robustness of gradient descent with the rapid convergence of Gauss-Newton. It is therefore one of the most widely used methods for solving nonlinear least-squares problems. A detailed treatment of the algorithm is available in (Lou05).

Starting from the Gauss-Newton system


\begin{displaymath}
\mathbf{J}_r^\top \mathbf{J}_r \,
\boldsymbol\delta_\beta
=
-\mathbf{J}_r^\top \mathbf r,
\end{displaymath} (4.61)

LM introduces a damping factor $\mu > 0$, giving the system


\begin{displaymath}
\left(
\mathbf{J}_r^\top \mathbf{J}_r
+
\mu \mathbf I
\right)
\boldsymbol\delta_\beta
=
-\mathbf{J}_r^\top \mathbf r .
\end{displaymath} (4.62)

The matrix


\begin{displaymath}
\mathbf N
=
\mathbf{J}_r^\top \mathbf{J}_r
+
\mu \mathbf I
\end{displaymath}

is positive definite for $\mu > 0$ and can therefore be inverted stably even when the problem is ill-conditioned.

When $\mu$ is large, the diagonal term dominates the system matrix, and the update tends to behave like gradient descent.

Conversely, for $\mu \rightarrow 0$, Equation (4.62) reduces to the Gauss-Newton step.

Unlike line search techniques, the LM method can be interpreted as a trust region method: the parameter $\mu$ implicitly controls how far one can move from the current point before the local linearization loses validity.

As in the Gauss-Newton method, the algorithm uses the approximation


\begin{displaymath}
\mathbf H_S(\boldsymbol\beta)
\approx
\mathbf J_r^\top \mathbf J_r
\end{displaymath} (4.63)

which is accurate when the residuals are small or when the model is locally nearly linear.

The initial value and update strategy for the parameter $\mu$ are left to the solver, and several strategies have been proposed in the literature. One widely used strategy (Nie99) initializes the parameter as


\begin{displaymath}
\mu_0
=
\tau
\max_i H_{ii}
\end{displaymath} (4.64)

where $H_{ii}$ are the diagonal elements of the matrix $\mathbf H \approx \mathbf J_r^\top \mathbf J_r$ and $\tau$ is a positive constant chosen by the user.

The quality of the update is evaluated using the gain ratio


\begin{displaymath}
\rho
=
\frac{
S(\boldsymbol\beta)
-
S(\boldsymbol\beta+\boldsymbol\delta_\beta)
}
{
L(\mathbf 0)-L(\boldsymbol\delta_\beta)
}
\end{displaymath} (4.65)

where the numerator represents the observed reduction in the cost function and the denominator the reduction predicted by the local quadratic model.

A high value of $\rho$ indicates that the local linearization accurately approximates the behavior of the cost function and that the proposed step can be accepted while reducing $\mu$.

Conversely, small or negative values of $\rho$ indicate that the local model does not adequately describe the problem and that the parameter $\mu$ should be increased, making the method more conservative and more like gradient descent.

One possible update strategy is


\begin{algorithmic}
\If {$\rho > 0$}
\State $\mu \gets \mu \cdot
\max \left(\f...
...tate $\mu \gets \mu \cdot \nu$
\State $\nu \gets 2\nu$
\EndIf
\end{algorithmic}

This is one of the choices commonly used in modern implementations of the algorithm.

Paolo medici
2026-10-19