where <math>\textbf{A}</math> is an <math>n \times n</math> symmetric positive definite matrix, <math>\textbf{x}</math> and <math>\textbf{b}</math> are <math>n \times 1</math> vectors.<br>
where <math>\textbf{A}</math> is an <math>n \times n</math> symmetric positive definite matrix, <math>\textbf{x}</math> and <math>\textbf{b}</math> are <math>n \times 1</math> vectors.<br>
The solution to the minimization problem is equivalent to solving the linear system, i.e. determining <math>x</math> when <math>\nabla F(x) = 0</math>, i.e.<math>\textbf{A}\textbf{x}-\textbf{b} = \textbf{0}</math><br><br>
The solution to the minimization problem is equivalent to solving the linear system, i.e. determining <math>\textbf{x}</math> when <math>\nabla F(x) = 0</math>, i.e.<math>\textbf{A}\textbf{x}-\textbf{b} = \textbf{0}</math><br><br>
The conjugate gradient method is often implemented as an iterative algorithm and can be considered as being between [https://en.wikipedia.org/wiki/Newton%27s_method Newton’s method], a second-order method that incorporates Hessian and gradient, and the method of steepest descent, a first-order method that uses gradient <ref>“Conjugate gradient method,” Wikipedia. Nov. 25, 2021. Accessed: Nov. 26, 2021. [Online]. Available: https://en.wikipedia.org/w/index.php?title=Conjugate_gradient_method&oldid=1057033318</ref>. Newton’s Method usually reduces the number of iterations needed, but the calculation of the Hessian matrix and its inverse increases the computation required for each iteration. Steepest descent takes repeated steps in the opposite direction of the gradient of the function at the current point. It often takes steps in the same direction as earlier ones, resulting in slow convergence (Figure 1). To avoid the high computational cost of Newton’s method and to accelerate the convergence rate of steepest descent, the conjugate gradient method was developed.<br><br>
The conjugate gradient method is often implemented as an iterative algorithm and can be considered as being between [https://en.wikipedia.org/wiki/Newton%27s_method Newton’s method], a second-order method that incorporates Hessian and gradient, and the method of steepest descent, a first-order method that uses gradient <ref>“Conjugate gradient method,” Wikipedia. Nov. 25, 2021. Accessed: Nov. 26, 2021. [Online]. Available: https://en.wikipedia.org/w/index.php?title=Conjugate_gradient_method&oldid=1057033318</ref>. Newton’s Method usually reduces the number of iterations needed, but the calculation of the Hessian matrix and its inverse increases the computation required for each iteration. Steepest descent takes repeated steps in the opposite direction of the gradient of the function at the current point. It often takes steps in the same direction as earlier ones, resulting in slow convergence (Figure 1). To avoid the high computational cost of Newton’s method and to accelerate the convergence rate of steepest descent, the conjugate gradient method was developed.<br><br>
Revision as of 15:35, 6 December 2021
Author: Alexandra Roberts, Anye Shi, Yue Sun (SYSEN 6800 Fall 2021)
Figure 1. A comparison of the convergence of gradient descent (in green) and conjugate vector (in red) for minimizing a quadratic function. In theory, the conjugate gradient method converges in at most steps, where is the size of the matrix of the system (here ).[1]
The conjugate gradient method (CG) was originally invented to minimize a quadratic function:
where is an symmetric positive definite matrix, and are vectors.
The solution to the minimization problem is equivalent to solving the linear system, i.e. determining when , i.e.
The conjugate gradient method is often implemented as an iterative algorithm and can be considered as being between Newton’s method, a second-order method that incorporates Hessian and gradient, and the method of steepest descent, a first-order method that uses gradient [2]. Newton’s Method usually reduces the number of iterations needed, but the calculation of the Hessian matrix and its inverse increases the computation required for each iteration. Steepest descent takes repeated steps in the opposite direction of the gradient of the function at the current point. It often takes steps in the same direction as earlier ones, resulting in slow convergence (Figure 1). To avoid the high computational cost of Newton’s method and to accelerate the convergence rate of steepest descent, the conjugate gradient method was developed.
The idea of the CG method is to pick orthogonal search directions first and, in each search direction, take exactly one step such that the step size is to the proposed solution at that direction. The solution is reached after steps [3] as, theoretically, the number of iterations needed by the CG method is equal to the number of different eigenvalues of , i.e. at most . This makes it attractive for large and sparse problems. The method can be used to solve least-squares problems and can also be generalized to a minimization method for general smooth functions [3].
Theory
The definition of A-conjugate direction
Let be a symmetric positive definite matrix. are the vectors that orthogonal (conjugate) to each other with respect to if .
Note that if , any two vectors will be conjugated to each other. If , conjugacy is equivalent to the conventional notion of orthogonality. If are -conjugated to each other, then the set of vectors are linearly independent.
As is a set of -conjugate vectors, then can be used as a basis and express the solution to is:
Then multiplying dKT on both sides
Because and the A-conjugacy of , i.e. , the multiplication will cancel out all the terms except for term k
Then the solution x* will be
Because A is a symmetric and positive-definite matrix, so the term defines an inner product and, therefore, no need to calculate the inversion of matrix A.
Conjugate Direction Theorem
Let be a set of nA-conjugate vectors, be a random starting point. Then
After n steps, xn = x*.
Proof:
Given
Therefore
The conjugate gradient method
The conjugate gradient method is a conjugate direction method in which selected successive direction vectors are treated as a conjugate version of the successive gradients obtained while the method progresses. The conjugate directions are not specified beforehand but rather are determined sequentially at each step of the iteration [4]. If the conjugate vectors are carefully chosen, then not all the conjugate vectors may be needed to obtain the solution. Therefore, the conjugate gradient method is regarded as an iterative method. This also allows approximate solutions to systems where n is so large that the direct method requires too much time [3].
Given be a set of nA-conjugate vectors, then can be minimized by stepping from along to the minimum , stepping from along to the minimum , etc. And let be randomly chosen, then the algorithm is the following:
Alg 1: Pick mutually A-conjugate, and from a random ,
For k = 1 to n
{
;
;
}
Return
Here Alg 1 is with a particular choice of . Let be the gradient at . A practical way to enforce this is by requiring that the next search direction be built out of the current gradient and all previous search directions. The CG method picks as the component of A-conjugate to :
As , for i = 1,...,k, giving the following CG algorithm: Alg 2: From a random ,
For k = 1 to n
{
;
if return ;
if (k > 1) ;
if (k = 1) ;
else ;
;
;
}
Return
The formulas in the Alg 2 can be simplified as the following:
Then and can be simplified by multiplying the above gradient formula by and as the following:
As ,
so we have
Therefore
This gives the following simplified version of Alg 2: Alg 3: From a random , and set ,
For k = 1 to n
{
if return ;
if (k > 1) ;
if (k = 1) ;
else ;
;
;
}
Return
Numerical example
Consider the linear system .
The initial starting point is set to be .
Implement the conjugate gradient method to approximate the solution to the system.
Solution:
The exact solution is given below for later reference: .
Step 1:
Step 2:
Step 3:
Step 4:
Step 5:
Step 6:
Step 7:
Step 8:
Therefore, is the approximation result of the system.
Application
Conjugate gradient methods have often been used to solve a wide variety of numerical problems, including linear and nonlinear algebraic equations, eigenvalue problems and minimization problems. These applications have been similar in that they involve large numbers of variables or dimensions. In these circumstances any method of solution which involves storing a full matrix of this large order, becomes inapplicable. Thus recourse to the conjugate gradient method may be the only alternative [5]. Here we show an example of image reconstruction.
Iterative image reconstruction
The conjugate gradient method is used to solve for the update in iterative image reconstruction problems. For example, in the magnetic resonance imaging (MRI) contrast known as quantitative susceptibility mapping (QSM), the reconstructed image is iteratively solved for from magnetic field data by the relation[6]
Where is the matrix expressing convolution with the dipole kernel in the Fourier domain. Given that the problem is ill-posed, a physical prior is used in the reconstruction, which is framed as a constrained L1 norm minimization
A detailed treatment of the function and can be found at [6]. This problem can be expressed as an unconstrained minimization problem via the Lagrange Multiplier Method
Where
The first-order conditions require and . These conditions result in and , respectively. The update can be solved for via fixed point iteration [6].
And expressed as the quasi-Newton problem, more robust to round-off error [6]
Which is solved with the CG method until the residual where is a specified tolerance, such as .
Conclusion
The conjugate gradient method was invented to avoid the high computational cost of Newton’s method and to accelerate the convergence rate of steepest descent. As an iterative method, each step only requires multiplication free from the storage of matrix . And selected direction vectors are treated as a conjugate version of the successive gradients obtained while the method progresses. So it monotonically improves approximations to the exact solution and may reach the required tolerance after a relatively small (compared to the problem size) number of iterations in the absence of round-off error, which makes it widely used for solving large and sparse problems.
Reference
↑Jonathan Shewchuk, “An Introduction to the Conjugate Gradient Method Without the Agonizing Pain,” 1994.
↑R. Fletcher, “Conjugate gradient methods for indefinite systems,” in Numerical Analysis, Berlin, Heidelberg, 1976, pp. 73–89. doi: 10.1007/BFb0080116.
↑ 6.06.16.26.3J. Liu et al., “Morphology enabled dipole inversion for quantitative susceptibility mapping using structural consistency between the magnitude image and the susceptibility map,” NeuroImage, vol. 59, no. 3, pp. 2560–2568, Feb. 2012, doi: 10.1016/j.neuroimage.2011.08.082.