QR分解
维基百科,自由的百科全书
QR分解法是三種将矩阵分解的方式之一。這種方式,把矩阵分解成一个正交矩阵与一个上三角矩阵的积。
目录 |
[编辑] QR分解的求法
QR分解的实际计算有很多方法,例如en:Givens rotation、Householder变换,以及Gram-Schmidt正交化等等。每一种方法都有其优点和不足。
[编辑] Gram-Schmidt正交化
Recall the Gram-Schmidt method, with the vectors to be considered in the process as columns of the matrix . Then
Naturally then, we rearrange the equations so the ais are the subject, to get the following
Each of these projections of the vectors onto one of these ej are merely the inner product of the two, since the vectors are normed.
Now these equations can be written in matrix form, viz.,
But the product of each row and column of the matrices above give us a respective column of A that we started with, and together, they give us the matrix A, so we have factorized A into an orthogonal matrix Q (the matrix of eks), via Gram Schmidt, and the obvious upper triangular matrix as a remainder R.
Alternatively, can be calculated as follows:
Recall that Then, we have
Note that
and QQT = I, so QT = Q − 1.
[编辑] Householder变换
[编辑] MatLab
MATLAB以qr函数来执行QR分解法,其语法为
- [Q,R]=qr(A)
- 其中Q代表正规正交矩阵,
- 而R代表上三角形矩阵。
此外,原矩阵A不必为正方矩阵; 如果矩阵A大小为m*n,则矩阵Q大小为m*m,矩阵R大小为m*n。