Anderson Acceleration
   HOME

TheInfoList



OR:

In mathematics, Anderson acceleration, also called Anderson mixing, is a method for the acceleration of the convergence rate of
fixed-point iteration In numerical analysis, fixed-point iteration is a method of computing fixed points of a function. More specifically, given a function f defined on the real numbers with real values and given a point x_0 in the domain of f, the fixed-point itera ...
s. Introduced by Donald G. Anderson, this technique can be used to find the solution to fixed point equations f(x) = x often arising in the field of computational science.


Definition

Given a function f:\mathbb^n \to \mathbb^n, consider the problem of finding a fixed point of f, which is a solution to the equation f(x) = x. A classical approach to the problem is to employ a
fixed-point iteration In numerical analysis, fixed-point iteration is a method of computing fixed points of a function. More specifically, given a function f defined on the real numbers with real values and given a point x_0 in the domain of f, the fixed-point itera ...
scheme; that is, given an initial guess x_0 for the solution, to compute the sequence x_ = f(x_i) until some convergence criterion is met. However, the convergence of such a scheme is not guaranteed in general; moreover, the
rate of convergence In numerical analysis, the order of convergence and the rate of convergence of a convergent sequence are quantities that represent how quickly the sequence approaches its limit. A sequence (x_n) that converges to x^* is said to have ''order of c ...
is usually linear, which can become too slow if the evaluation of the function f is computationally expensive. Anderson acceleration is a method to accelerate the convergence of the fixed-point sequence. Define the residual g(x) = f(x) - x, and denote f_k = f(x_k) and g_k = g(x_k) (where x_k corresponds to the sequence of iterates from the previous paragraph). Given an initial guess x_0 and an integer parameter m \geq 1, the method can be formulated as follows: :x_1 = f(x_0) :\forall k = 1, 2, \dots ::m_k = \min\ ::G_k = \begin g_ & \dots & g_k \end ::\alpha_k = \operatorname_ \, G_k \alpha\, _2, \quad \text\;A_k = \ ::x_ = \sum_^(\alpha_k)_i f_ where the matrix–vector multiplication G_k \alpha = \sum_^(\alpha)_i g_, and (\alpha)_i is the ith element of \alpha. Conventional stopping criteria can be used to end the iterations of the method. For example, iterations can be stopped when \, x_ - x_k\, falls under a prescribed tolerance, or when the residual g(x_k) falls under a prescribed tolerance. With respect to the standard fixed-point iteration, the method has been found to converge faster and be more robust, and in some cases avoid the divergence of the fixed-point sequence.


Derivation

For the solution x^*, we know that f(x^*) = x^*, which is equivalent to saying that g(x^*) = \vec. We can therefore rephrase the problem as an optimization problem where we want to minimize \, g(x)\, _2. Instead of going directly from x_k to x_ by choosing x_ = f(x_k) as in
fixed-point iteration In numerical analysis, fixed-point iteration is a method of computing fixed points of a function. More specifically, given a function f defined on the real numbers with real values and given a point x_0 in the domain of f, the fixed-point itera ...
, let's consider an intermediate point x'_ that we choose to be the linear combination x'_ = X_k \alpha_k , where the coefficient vector \alpha_k \in A_k, and X_k = \begin x_ & \dots & x_k \end is the matrix containing the last m_k+1 points, and choose x'_ such that it minimizes \, g(x'_)\, _2. Since the elements in \alpha_k sum to one, we can make the first order approximation g(X_k\alpha_k) = g\left(\sum_^ (\alpha_k)_i x_\right) \approx \sum_^ (\alpha_k)_i g(x_) = G_k\alpha_k, and our problem becomes to find the \alpha that minimizes \, G_k\alpha\, _2. After having found \alpha_k, we could in principle calculate x'_. However, since f is designed to bring a point closer to x^*, f(x'_) is probably closer to x^* than what x'_ is, so it makes sense to choose x_=f(x'_) rather than x_=x'_. Furthermore, since the elements in \alpha_k sum to one, we can make the first order approximation f(x'_) = f\left(\sum_^(\alpha_k)_i x_\right) \approx \sum_^(\alpha_k)_i f(x_) = \sum_^(\alpha_k)_i f_. We therefore choose x_ = \sum_^(\alpha_k)_i f_.


Solution of the minimization problem

At each iteration of the algorithm, the constrained
optimization Mathematical optimization (alternatively spelled ''optimisation'') or mathematical programming is the selection of a best element, with regard to some criterion, from some set of available alternatives. It is generally divided into two subfi ...
problem \operatorname\, G_k \alpha\, _2, subject to \alpha\in A_k needs to be solved. The problem can be recast in several equivalent formulations, yielding different solution methods which may result in a more convenient implementation: * defining the matrices \mathcal_k = \begin g_ - g_ & \dots & g_ - g_\end and \mathcal_k = \begin x_ - x_ & \dots & x_ - x_ \end, solve \gamma_k = \operatorname_\, g_k - \mathcal_k\gamma\, _2, and set x_ = x_k + g_k - (\mathcal_k + \mathcal_k)\gamma_k; * solve \theta_k = \_^ = \operatorname_\left\, g_k + \sum_^\theta_i(g_ - g_k)\right\, _2, then set x_ = x_k + g_k + \sum_^(\theta_k)_j(x_ - x_k + g_ - g_k). For both choices, the optimization problem is in the form of an unconstrained linear least-squares problem, which can be solved by standard methods including
QR decomposition In linear algebra, a QR decomposition, also known as a QR factorization or QU factorization, is a decomposition of a matrix ''A'' into a product ''A'' = ''QR'' of an orthogonal matrix ''Q'' and an upper triangular matrix ''R''. QR decomp ...
and
singular value decomposition In linear algebra, the singular value decomposition (SVD) is a factorization of a real or complex matrix. It generalizes the eigendecomposition of a square normal matrix with an orthonormal eigenbasis to any \ m \times n\ matrix. It is re ...
, possibly including regularization techniques to deal with rank deficiencies and conditioning issues in the optimization problem. Solving the least-squares problem by solving the
normal equations In statistics, ordinary least squares (OLS) is a type of linear least squares method for choosing the unknown parameters in a linear regression model (with fixed level-one effects of a linear function of a set of explanatory variables) by the p ...
is generally not advisable due to potential numerical instabilities and generally high computational cost. Stagnation in the method (i.e. subsequent iterations with the same value, x_ = x_k) causes the method to break down, due to the singularity of the least-squares problem. Similarly, near-stagnation (x_\approx x_k) results in bad conditioning of the least squares problem. Moreover, the choice of the parameter m might be relevant in determining the conditioning of the least-squares problem, as discussed below.


Relaxation

The algorithm can be modified introducing a variable relaxation parameter (or mixing parameter) \beta_k > 0. At each step, compute the new iterate as x_ = (1 - \beta_k)\sum_^(\alpha_k)_i x_ + \beta_k \sum_^(\alpha_k)_i f(x_)\;.The choice of \beta_k is crucial to the convergence properties of the method; in principle, \beta_k might vary at each iteration, although it is often chosen to be constant.


Choice of

The parameter m determines how much information from previous iterations is used to compute the new iteration x_. On the one hand, if m is chosen to be too small, too little information is used and convergence may be undesirably slow. On the other hand, if m is too large, information from old iterations may be retained for too many subsequent iterations, so that again convergence may be slow. Moreover, the choice of m affects the size of the optimization problem. A too large value of m may worsen the conditioning of the least squares problem and the cost of its solution. In general, the particular problem to be solved determines the best choice of the m parameter.


Choice of

With respect to the algorithm described above, the choice of m_k at each iteration can be modified. One possibility is to choose m_k = k for each iteration k (sometimes referred to as Anderson acceleration without truncation). This way, every new iteration x_ is computed using all the previously computed iterations. A more sophisticated technique is based on choosing m_k so as to maintain a small enough conditioning for the least-squares problem.


Relations to other classes of methods

Newton's method can be applied to the solution of f(x) - x = 0 to compute a fixed point of f(x) with quadratic convergence. However, such method requires the evaluation of the exact derivative of f(x), which can be very costly. Approximating the derivative by means of
finite difference A finite difference is a mathematical expression of the form . If a finite difference is divided by , one gets a difference quotient. The approximation of derivatives by finite differences plays a central role in finite difference methods for t ...
s is a possible alternative, but it requires multiple evaluations of f(x) at each iteration, which again can become very costly. Anderson acceleration requires only one evaluation of the function f(x) per iteration, and no evaluation of its derivative. On the other hand, the convergence of an Anderson-accelerated fixed point sequence is still linear in general. Several authors have pointed out similarities between the Anderson acceleration scheme and other methods for the solution of non-linear equations. In particular: * Eyert and Fang and Saad interpreted the algorithm within the class of quasi-Newton and multisecant methods, that generalize the well known
secant method In numerical analysis, the secant method is a root-finding algorithm that uses a succession of roots of secant lines to better approximate a root of a function ''f''. The secant method can be thought of as a finite-difference approximation o ...
, for the solution of the non-linear equation g(x) = 0; they also showed how the scheme can be seen as a method in the Broyden class; * Walker and Ni showed that the Anderson acceleration scheme is equivalent to the
GMRES In mathematics, the generalized minimal residual method (GMRES) is an iterative method for the numerical solution of an indefinite nonsymmetric system of linear equations. The method approximates the solution by the vector in a Krylov subspace wit ...
method in the case of linear problems (i.e. the problem of finding a solution to A\mathbf = \mathbf for some square matrix A), and can thus be seen as a generalization of GMRES to the non-linear case; a similar result was found by Washio and Oosterlee. Moreover, several equivalent or nearly equivalent methods have been independently developed by other authors, although most often in the context of some specific application of interest rather than as a general method for fixed point equations.


Example MATLAB implementation

The following is an example implementation in
MATLAB MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementa ...
language of the Anderson acceleration scheme for finding the fixed-point of the function f(x) = \sin(x) + \arctan(x). Notice that: * the optimization problem was solved in the form \gamma_k = \operatorname_\, g_k - \mathcal_k\gamma\, _2 using QR decomposition; * the computation of the QR decomposition is sub-optimal: indeed, at each iteration a single column is added to the matrix \mathcal_k, and possibly a single column is removed; this fact can be exploited to efficiently update the QR decomposition with less computational effort; * the algorithm can be made more memory-efficient by storing only the latest few iterations and residuals, if the whole vector of iterations x_k is not needed; * the code is straightforwardly generalized to the case of a vector-valued f(x). f = @(x) sin(x) + atan(x); % Function whose fixed point is to be computed. x0 = 1; % Initial guess. k_max = 100; % Maximum number of iterations. tol_res = 1e-6; % Tolerance on the residual. m = 3; % Parameter m. x = 0, f(x0) % Vector of iterates x. g = f(x) - x; % Vector of residuals. G_k = g(2) - g(1); % Matrix of increments in residuals. X_k = x(2) - x(1); % Matrix of increments in x. k = 2; while k < k_max && abs(g(k)) > tol_res m_k = min(k, m); % Solve the optimization problem by QR decomposition. , R= qr(G_k); gamma_k = R \ (Q' * g(k)); % Compute new iterate and new residual. x(k + 1) = x(k) + g(k) - (X_k + G_k) * gamma_k; g(k + 1) = f(x(k + 1)) - x(k + 1); % Update increment matrices with new elements. X_k = _k, x(k + 1) - x(k) G_k = _k, g(k + 1) - g(k) n = size(X_k, 2); if n > m_k X_k = X_k(:, n - m_k + 1:end); G_k = G_k(:, n - m_k + 1:end); end k = k + 1; end % Prints result: Computed fixed point 2.013444 after 9 iterations fprintf("Computed fixed point %f after %d iterations\n", x(end), k);


See also

* Fixed-point *
Fixed-point iteration In numerical analysis, fixed-point iteration is a method of computing fixed points of a function. More specifically, given a function f defined on the real numbers with real values and given a point x_0 in the domain of f, the fixed-point itera ...
*
Root-finding algorithms In mathematics and computing, a root-finding algorithm is an algorithm for finding zeros, also called "roots", of continuous functions. A zero of a function , from the real numbers to real numbers or from the complex numbers to the complex numbers ...


Notes


References

{{reflist Numerical analysis Quasi-Newton methods Iterative methods