Preconditioner

From HandWiki
Short description: Transforms equations for numerical solution

In mathematics, preconditioning is the application of a transformation, called the preconditioner, that conditions a given problem into a form that is more suitable for numerical solving methods. Preconditioning is typically related to reducing a condition number of the problem. The preconditioned problem is then usually solved by an iterative method.

Preconditioning for linear systems

In linear algebra and numerical analysis, a preconditioner [math]\displaystyle{ P }[/math] of a matrix [math]\displaystyle{ A }[/math] is a matrix such that [math]\displaystyle{ P^{-1}A }[/math] has a smaller condition number than [math]\displaystyle{ A }[/math]. It is also common to call [math]\displaystyle{ T=P^{-1} }[/math] the preconditioner, rather than [math]\displaystyle{ P }[/math], since [math]\displaystyle{ P }[/math] itself is rarely explicitly available. In modern preconditioning, the application of [math]\displaystyle{ T = P^{-1} }[/math], i.e., multiplication of a column vector, or a block of column vectors, by [math]\displaystyle{ T = P^{-1} }[/math], is commonly performed in a matrix-free fashion, i.e., where neither [math]\displaystyle{ P }[/math], nor [math]\displaystyle{ T = P^{-1} }[/math] (and often not even [math]\displaystyle{ A }[/math]) are explicitly available in a matrix form.

Preconditioners are useful in iterative methods to solve a linear system [math]\displaystyle{ Ax=b }[/math] for [math]\displaystyle{ x }[/math] since the rate of convergence for most iterative linear solvers increases because the condition number of a matrix decreases as a result of preconditioning. Preconditioned iterative solvers typically outperform direct solvers, e.g., Gaussian elimination, for large, especially for sparse, matrices. Iterative solvers can be used as matrix-free methods, i.e. become the only choice if the coefficient matrix [math]\displaystyle{ A }[/math] is not stored explicitly, but is accessed by evaluating matrix-vector products.

Description

Instead of solving the original linear system [math]\displaystyle{ Ax=b }[/math] for [math]\displaystyle{ x }[/math], one may consider the right preconditioned system [math]\displaystyle{ AP^{-1}(Px) = b }[/math] and solve [math]\displaystyle{ AP^{-1}y=b }[/math] for [math]\displaystyle{ y }[/math] and [math]\displaystyle{ Px = y }[/math] for [math]\displaystyle{ x }[/math].

Alternatively, one may solve the left preconditioned system [math]\displaystyle{ P^{-1}(Ax-b)=0 . }[/math]

Both systems give the same solution as the original system as long as the preconditioner matrix [math]\displaystyle{ P }[/math] is nonsingular. The left preconditioning is more traditional.

The two-sided preconditioned system [math]\displaystyle{ QAP^{-1}(Px) = Qb }[/math] may be beneficial, e.g., to preserve the matrix symmetry: if the original matrix [math]\displaystyle{ A }[/math] is real symmetric and real preconditioners [math]\displaystyle{ Q }[/math] and [math]\displaystyle{ P }[/math] satisfy [math]\displaystyle{ Q^{T} = P^{-1} }[/math] then the preconditioned matrix [math]\displaystyle{ QAP^{-1} }[/math] is also symmetric. The two-sided preconditioning is common for diagonal scaling where the preconditioners [math]\displaystyle{ Q }[/math] and [math]\displaystyle{ P }[/math] are diagonal and scaling is applied both to columns and rows of the original matrix [math]\displaystyle{ A }[/math], e.g., in order to decrease the dynamic range of entries of the matrix.

The goal of preconditioning is reducing the condition number, e.g., of the left or right preconditioned system matrix [math]\displaystyle{ P^{-1}A }[/math] or [math]\displaystyle{ AP^{-1} }[/math]. Small condition numbers benefit fast convergence of iterative solvers and improve stability of the solution with respect to perturbations in the system matrix and the right-hand side, e.g., allowing for more aggressive quantization of the matrix entries using lower computer precision.

The preconditioned matrix [math]\displaystyle{ P^{-1}A }[/math] or [math]\displaystyle{ AP^{-1} }[/math] is rarely explicitly formed. Only the action of applying the preconditioner solve operation [math]\displaystyle{ P^{-1} }[/math] to a given vector may need to be computed.

Typically there is a trade-off in the choice of [math]\displaystyle{ P }[/math]. Since the operator [math]\displaystyle{ P^{-1} }[/math] must be applied at each step of the iterative linear solver, it should have a small cost (computing time) of applying the [math]\displaystyle{ P^{-1} }[/math] operation. The cheapest preconditioner would therefore be [math]\displaystyle{ P=I }[/math] since then [math]\displaystyle{ P^{-1}=I. }[/math] Clearly, this results in the original linear system and the preconditioner does nothing. At the other extreme, the choice [math]\displaystyle{ P=A }[/math] gives [math]\displaystyle{ P^{-1}A = AP^{-1} = I, }[/math] which has optimal condition number of 1, requiring a single iteration for convergence; however in this case [math]\displaystyle{ P^{-1}=A^{-1}, }[/math] and applying the preconditioner is as difficult as solving the original system. One therefore chooses [math]\displaystyle{ P }[/math] as somewhere between these two extremes, in an attempt to achieve a minimal number of linear iterations while keeping the operator [math]\displaystyle{ P^{-1} }[/math] as simple as possible. Some examples of typical preconditioning approaches are detailed below.

Preconditioned iterative methods

Preconditioned iterative methods for [math]\displaystyle{ Ax - b = 0 }[/math] are, in most cases, mathematically equivalent to standard iterative methods applied to the preconditioned system [math]\displaystyle{ P^{-1}(Ax-b)=0. }[/math] For example, the standard Richardson iteration for solving [math]\displaystyle{ Ax - b = 0 }[/math] is [math]\displaystyle{ \mathbf{x}_{n+1}=\mathbf{x}_n-\gamma_n (A\mathbf{x}_n-\mathbf{b}),\ n \ge 0. }[/math]

Applied to the preconditioned system [math]\displaystyle{ P^{-1}(Ax-b)=0, }[/math] it turns into a preconditioned method [math]\displaystyle{ \mathbf{x}_{n+1}=\mathbf{x}_n-\gamma_n P^{-1}(A\mathbf{x}_n-\mathbf{b}),\ n \ge 0. }[/math]

Examples of popular preconditioned iterative methods for linear systems include the preconditioned conjugate gradient method, the biconjugate gradient method, and generalized minimal residual method. Iterative methods, which use scalar products to compute the iterative parameters, require corresponding changes in the scalar product together with substituting [math]\displaystyle{ P^{-1}(Ax-b) = 0 }[/math] for [math]\displaystyle{ Ax-b = 0. }[/math]

Matrix splitting

A stationary iterative method is determined by the matrix splitting [math]\displaystyle{ A=M-N }[/math] and the iteration matrix [math]\displaystyle{ C=I-M^{-1}A }[/math]. Assuming that

  • the system matrix [math]\displaystyle{ A }[/math] is symmetric positive-definite,
  • the splitting matrix [math]\displaystyle{ M }[/math] is symmetric positive-definite,
  • the stationary iterative method is convergent, as determined by [math]\displaystyle{ \rho(C) \lt 1 }[/math],

the condition number [math]\displaystyle{ \kappa(M^{-1}A) }[/math] is bounded above by [math]\displaystyle{ \kappa(M^{-1}A) \leq \frac{1+\rho(C)}{1-\rho(C)} \,. }[/math]

Geometric interpretation

For a symmetric positive definite matrix [math]\displaystyle{ A }[/math] the preconditioner [math]\displaystyle{ P }[/math] is typically chosen to be symmetric positive definite as well. The preconditioned operator [math]\displaystyle{ P^{-1}A }[/math] is then also symmetric positive definite, but with respect to the [math]\displaystyle{ P }[/math]-based scalar product. In this case, the desired effect in applying a preconditioner is to make the quadratic form of the preconditioned operator [math]\displaystyle{ P^{-1}A }[/math] with respect to the [math]\displaystyle{ P }[/math]-based scalar product to be nearly spherical.[1]

Variable and non-linear preconditioning

Denoting [math]\displaystyle{ T = P^{-1} }[/math], we highlight that preconditioning is practically implemented as multiplying some vector [math]\displaystyle{ r }[/math] by [math]\displaystyle{ T }[/math], i.e., computing the product [math]\displaystyle{ Tr. }[/math] In many applications, [math]\displaystyle{ T }[/math] is not given as a matrix, but rather as an operator [math]\displaystyle{ T(r) }[/math] acting on the vector [math]\displaystyle{ r }[/math]. Some popular preconditioners, however, change with [math]\displaystyle{ r }[/math] and the dependence on [math]\displaystyle{ r }[/math] may not be linear. Typical examples involve using non-linear iterative methods, e.g., the conjugate gradient method, as a part of the preconditioner construction. Such preconditioners may be practically very efficient, however, their behavior is hard to predict theoretically.

Random preconditioning

One interesting particular case of variable preconditioning is random preconditioning, e.g., multigrid preconditioning on random course grids.[2] If used in gradient descent methods, random preconditioning can be viewed as an implementation of stochastic gradient descent and can lead to faster convergence, compared to fixed preconditioning, since it breaks the asymptotic "zig-zag" pattern of the gradient descent.

Spectrally equivalent preconditioning

The most common use of preconditioning is for iterative solution of linear systems resulting from approximations of partial differential equations. The better the approximation quality, the larger the matrix size is. In such a case, the goal of optimal preconditioning is, on the one side, to make the spectral condition number of [math]\displaystyle{ P^{-1}A }[/math] to be bounded from above by a constant independent of the matrix size, which is called spectrally equivalent preconditioning by D'yakonov. On the other hand, the cost of application of the [math]\displaystyle{ P^{-1} }[/math] should ideally be proportional (also independent of the matrix size) to the cost of multiplication of [math]\displaystyle{ A }[/math] by a vector.

Examples

Jacobi (or diagonal) preconditioner

The Jacobi preconditioner is one of the simplest forms of preconditioning, in which the preconditioner is chosen to be the diagonal of the matrix [math]\displaystyle{ P = \mathrm{diag}(A). }[/math] Assuming [math]\displaystyle{ A_{ii} \neq 0, \forall i }[/math], we get [math]\displaystyle{ P^{-1}_{ij} = \frac{\delta_{ij}}{A_{ij}}. }[/math] It is efficient for diagonally dominant matrices [math]\displaystyle{ A }[/math]. It is used in analysis softwares for beam problems or 1-D problems (EX:- STAAD.Pro)

SPAI

The Sparse Approximate Inverse preconditioner minimises [math]\displaystyle{ \|AT-I\|_F, }[/math] where [math]\displaystyle{ \|\cdot\|_F }[/math] is the Frobenius norm and [math]\displaystyle{ T = P^{-1} }[/math] is from some suitably constrained set of sparse matrices. Under the Frobenius norm, this reduces to solving numerous independent least-squares problems (one for every column). The entries in [math]\displaystyle{ T }[/math] must be restricted to some sparsity pattern or the problem remains as difficult and time-consuming as finding the exact inverse of [math]\displaystyle{ A }[/math]. The method was introduced by M.J. Grote and T. Huckle together with an approach to selecting sparsity patterns.[3]

Other preconditioners

External links

Preconditioning for eigenvalue problems

Eigenvalue problems can be framed in several alternative ways, each leading to its own preconditioning. The traditional preconditioning is based on the so-called spectral transformations. Knowing (approximately) the targeted eigenvalue, one can compute the corresponding eigenvector by solving the related homogeneous linear system, thus allowing to use preconditioning for linear system. Finally, formulating the eigenvalue problem as optimization of the Rayleigh quotient brings preconditioned optimization techniques to the scene.[4]

Spectral transformations

By analogy with linear systems, for an eigenvalue problem [math]\displaystyle{ Ax = \lambda x }[/math] one may be tempted to replace the matrix [math]\displaystyle{ A }[/math] with the matrix [math]\displaystyle{ P^{-1}A }[/math] using a preconditioner [math]\displaystyle{ P }[/math]. However, this makes sense only if the seeking eigenvectors of [math]\displaystyle{ A }[/math] and [math]\displaystyle{ P^{-1}A }[/math] are the same. This is the case for spectral transformations.

The most popular spectral transformation is the so-called shift-and-invert transformation, where for a given scalar [math]\displaystyle{ \alpha }[/math], called the shift, the original eigenvalue problem [math]\displaystyle{ Ax = \lambda x }[/math] is replaced with the shift-and-invert problem [math]\displaystyle{ (A-\alpha I)^{-1}x = \mu x }[/math]. The eigenvectors are preserved, and one can solve the shift-and-invert problem by an iterative solver, e.g., the power iteration. This gives the Inverse iteration, which normally converges to the eigenvector, corresponding to the eigenvalue closest to the shift [math]\displaystyle{ \alpha }[/math]. The Rayleigh quotient iteration is a shift-and-invert method with a variable shift.

Spectral transformations are specific for eigenvalue problems and have no analogs for linear systems. They require accurate numerical calculation of the transformation involved, which becomes the main bottleneck for large problems.

General preconditioning

To make a close connection to linear systems, let us suppose that the targeted eigenvalue [math]\displaystyle{ \lambda_\star }[/math] is known (approximately). Then one can compute the corresponding eigenvector from the homogeneous linear system [math]\displaystyle{ (A-\lambda_\star I)x=0 }[/math]. Using the concept of left preconditioning for linear systems, we obtain [math]\displaystyle{ T(A-\lambda_\star I)x=0 }[/math], where [math]\displaystyle{ T }[/math] is the preconditioner, which we can try to solve using the Richardson iteration

[math]\displaystyle{ \mathbf{x}_{n+1} = \mathbf{x}_n-\gamma_n T(A-\lambda_\star I)\mathbf{x}_n,\ n \ge 0. }[/math]

The ideal preconditioning[4]

The Moore–Penrose pseudoinverse [math]\displaystyle{ T=(A-\lambda_\star I)^+ }[/math] is the preconditioner, which makes the Richardson iteration above converge in one step with [math]\displaystyle{ \gamma_n=1 }[/math], since [math]\displaystyle{ I-(A-\lambda_\star I)^+(A-\lambda_\star I) }[/math], denoted by [math]\displaystyle{ P_\star }[/math], is the orthogonal projector on the eigenspace, corresponding to [math]\displaystyle{ \lambda_\star }[/math]. The choice [math]\displaystyle{ T=(A-\lambda_\star I)^+ }[/math] is impractical for three independent reasons. First, [math]\displaystyle{ \lambda_\star }[/math] is actually not known, although it can be replaced with its approximation [math]\displaystyle{ \tilde\lambda_\star }[/math]. Second, the exact Moore–Penrose pseudoinverse requires the knowledge of the eigenvector, which we are trying to find. This can be somewhat circumvented by the use of the Jacobi–Davidson preconditioner [math]\displaystyle{ T=(I-\tilde P_\star)(A-\tilde\lambda_\star I)^{-1}(I-\tilde P_\star) }[/math], where [math]\displaystyle{ \tilde P_\star }[/math] approximates [math]\displaystyle{ P_\star }[/math]. Last, but not least, this approach requires accurate numerical solution of linear system with the system matrix [math]\displaystyle{ (A-\tilde\lambda_\star I) }[/math], which becomes as expensive for large problems as the shift-and-invert method above. If the solution is not accurate enough, step two may be redundant.

Practical preconditioning

Let us first replace the theoretical value [math]\displaystyle{ \lambda_\star }[/math] in the Richardson iteration above with its current approximation [math]\displaystyle{ \lambda_n }[/math] to obtain a practical algorithm [math]\displaystyle{ \mathbf{x}_{n+1} = \mathbf{x}_n-\gamma_n T(A-\lambda_n I)\mathbf{x}_n,\ n \ge 0. }[/math]

A popular choice is [math]\displaystyle{ \lambda_n = \rho(x_n) }[/math] using the Rayleigh quotient function [math]\displaystyle{ \rho(\cdot) }[/math]. Practical preconditioning may be as trivial as just using [math]\displaystyle{ T=(\operatorname{diag}(A))^{-1} }[/math] or [math]\displaystyle{ T=(\operatorname{diag}(A-\lambda_n I))^{-1}. }[/math] For some classes of eigenvalue problems the efficiency of [math]\displaystyle{ T\approx A^{-1} }[/math] has been demonstrated, both numerically and theoretically. The choice [math]\displaystyle{ T\approx A^{-1} }[/math] allows one to easily utilize for eigenvalue problems the vast variety of preconditioners developed for linear systems.

Due to the changing value [math]\displaystyle{ \lambda_n }[/math], a comprehensive theoretical convergence analysis is much more difficult, compared to the linear systems case, even for the simplest methods, such as the Richardson iteration.

External links

Preconditioning in optimization

Illustration of gradient descent

In optimization, preconditioning is typically used to accelerate first-order optimization algorithms.

Description

For example, to find a local minimum of a real-valued function [math]\displaystyle{ F(\mathbf{x}) }[/math] using gradient descent, one takes steps proportional to the negative of the gradient [math]\displaystyle{ -\nabla F(\mathbf{a}) }[/math] (or of the approximate gradient) of the function at the current point: [math]\displaystyle{ \mathbf{x}_{n+1}=\mathbf{x}_n-\gamma_n \nabla F(\mathbf{x}_n),\ n \ge 0. }[/math]

The preconditioner is applied to the gradient: [math]\displaystyle{ \mathbf{x}_{n+1}=\mathbf{x}_n-\gamma_n P^{-1} \nabla F(\mathbf{x}_n),\ n \ge 0. }[/math]

Preconditioning here can be viewed as changing the geometry of the vector space with the goal to make the level sets look like circles.[5] In this case the preconditioned gradient aims closer to the point of the extrema as on the figure, which speeds up the convergence.

Connection to linear systems

The minimum of a quadratic function [math]\displaystyle{ F(\mathbf{x}) = \tfrac{1}{2}\mathbf{x}^T A\mathbf{x}-\mathbf{x}^T\mathbf{b}, }[/math] where [math]\displaystyle{ \mathbf{x} }[/math] and [math]\displaystyle{ \mathbf{b} }[/math] are real column-vectors and [math]\displaystyle{ A }[/math] is a real symmetric positive-definite matrix, is exactly the solution of the linear equation [math]\displaystyle{ A\mathbf{x} = \mathbf{b} }[/math]. Since [math]\displaystyle{ \nabla F(\mathbf{x}) = A\mathbf{x}-\mathbf{b} }[/math], the preconditioned gradient descent method of minimizing [math]\displaystyle{ F(\mathbf{x}) }[/math] is [math]\displaystyle{ \mathbf{x}_{n+1}=\mathbf{x}_n-\gamma_n P^{-1}(A\mathbf{x}_n-\mathbf{b}),\ n \ge 0. }[/math]

This is the preconditioned Richardson iteration for solving a system of linear equations.

Connection to eigenvalue problems

The minimum of the Rayleigh quotient [math]\displaystyle{ \rho(\mathbf{x})= \frac{\mathbf{x}^TA\mathbf{x}}{\mathbf{x}^T\mathbf{x}}, }[/math] where [math]\displaystyle{ \mathbf{x} }[/math] is a real non-zero column-vector and [math]\displaystyle{ A }[/math] is a real symmetric positive-definite matrix, is the smallest eigenvalue of [math]\displaystyle{ A }[/math], while the minimizer is the corresponding eigenvector. Since [math]\displaystyle{ \nabla \rho(\mathbf{x}) }[/math] is proportional to [math]\displaystyle{ A\mathbf{x}-\rho(\mathbf{x})\mathbf{x} }[/math], the preconditioned gradient descent method of minimizing [math]\displaystyle{ \rho(\mathbf{x}) }[/math] is [math]\displaystyle{ \mathbf{x}_{n+1}=\mathbf{x}_n-\gamma_n P^{-1}(A\mathbf{x}_n-\rho(\mathbf{x_n})\mathbf{x_n}),\ n \ge 0. }[/math]

This is an analog of preconditioned Richardson iteration for solving eigenvalue problems.

Variable preconditioning

In many cases, it may be beneficial to change the preconditioner at some or even every step of an iterative algorithm in order to accommodate for a changing shape of the level sets, as in [math]\displaystyle{ \mathbf{x}_{n+1}=\mathbf{x}_n-\gamma_n P_n^{-1} \nabla F(\mathbf{x}_n),\ n \ge 0. }[/math]

One should have in mind, however, that constructing an efficient preconditioner is very often computationally expensive. The increased cost of updating the preconditioner can easily override the positive effect of faster convergence. If [math]\displaystyle{ P_n^{-1} = H_n }[/math], a BFGS approximation of the inverse hessian matrix, this method is referred to as a Quasi-Newton method.

References

  1. Shewchuk, Jonathan Richard (August 4, 1994). "An Introduction to the Conjugate Gradient Method Without the Agonizing Pain". https://www.cs.cmu.edu/~quake-papers/painless-conjugate-gradient.pdf#page=24. 
  2. Henricus Bouwmeester, Andrew Dougherty, Andrew V Knyazev. Nonsymmetric Preconditioning for Conjugate Gradient and Steepest Descent Methods. Procedia Computer Science, Volume 51, Pages 276-285, Elsevier, 2015. https://doi.org/10.1016/j.procs.2015.05.241
  3. Grote, M. J.; Huckle, T. (1997). "Parallel Preconditioning with Sparse Approximate Inverses". SIAM Journal on Scientific Computing 18 (3): 838–53. doi:10.1137/S1064827594276552. 
  4. 4.0 4.1 Knyazev, Andrew V. (1998). "Preconditioned eigensolvers - an oxymoron?". Electronic Transactions on Numerical Analysis 7: 104–123. http://etna.mcs.kent.edu/vol.7.1998/pp104-123.dir/. 
  5. Himmelblau, David M. (1972). Applied Nonlinear Programming. New York: McGraw-Hill. pp. 78–83. ISBN 0-07-028921-2. 

Sources