Chapter 2 (Matrix Algebra): Matrix factorizations (矩阵因式分解)

本文为《Linear algebra and its applications》的读书笔记

  • A f a c t o r i z a t i o n factorization factorization of a matrix A A A is an equation that expresses A A A as a product of two or more matrices. Whereas matrix multiplication involves a s y n t h e s i s synthesis synthesis of data (combining the effects of two or more linear transformations into a single matrix).
  • In the language of computer science, the expression of A A A as a product amounts to a preprocessing of the data in A A A, organizing that data into two or more parts whose structures are more useful in some way, perhaps more accessible for computation(便于计算).

The LU Factorization

LU 分解

What is LU Factorization?

  • Any m × n m\times n m×n matrix A A A admits a factorization A = L U A = LU A=LU, where L L L is an m × m m \times m m×m permuted unit lower triangular matrix with 1’s on the diagonal and U U U is an m × n m \times n m×n echelon form of A A A.
    • That is, L L L is a matrix such that a permutation (rearrangement) of its rows (using row interchanges) will produce a lower triangular matrix with 1’s on the diagonal.
      在这里插入图片描述

注:如果将 A A A 行变换至 U U U 的过程中不需要使用 row interchange,那么 L L L 为单位下三角矩阵;下面在讲到 “Permuted LU Factorizations” 之前都假设 A A A 行变换至 U U U 的过程中不需要使用 row interchange

Why LU Factorization?

  • When A = L U A = LU A=LU, the equation A x = b A\boldsymbol x = \boldsymbol b Ax=b can be written as L ( U x ) = b L(U\boldsymbol x)=\boldsymbol b L(Ux)=b. Writing y \boldsymbol y y for U x U\boldsymbol x Ux, we can find x \boldsymbol x x by solving the pair of equations
    在这里插入图片描述First solve L y = b L\boldsymbol y = \boldsymbol b Ly=b for y \boldsymbol y y; and then solve U x = y U\boldsymbol x =\boldsymbol y Ux=y for x \boldsymbol x x. See Figure 2. Each equation is easy to solve because L L L and U U U are triangular.
    在这里插入图片描述
  • When A A A is invertible, MATLAB finds A − 1 A^{-1} A1 by factoring A = L U A =LU A=LU (where L L L may be permuted lower triangular), inverting L L L and U U U, and then computing U − 1 L − 1 U^{-1}L^{-1} U1L1.

EXAMPLE 1

  • It can be verified that
    在这里插入图片描述Use this LU factorization of A A A to solve A x = b A\boldsymbol x = \boldsymbol b Ax=b, where b = [ − 9 5 7 11 ] \boldsymbol b =\begin{bmatrix} -9\\5\\7\\11\end{bmatrix} b=95711.

SOLUTION

  • The solution of L y = b L\boldsymbol y = \boldsymbol b Ly=b needs only 6 multiplications and 6 additions.
    在这里插入图片描述Then, for U x = y U\boldsymbol x = \boldsymbol y Ux=y, the “backward” phase of row reduction requires 4 divisions, 6 multiplications, and 6 additions. (For instance, creating the zeros in column 4 requires 1 division in row 4 and 3 multiplication–addition pairs to add multiples of row 4 to the rows above.)
    在这里插入图片描述
  • To find x \boldsymbol x x requires 28 arithmetic operations, or “flops” (floating point operations), excluding the cost of finding L L L and U U U. In contrast, row reduction of [    A     b    ] [ \ \ A\ \ \ \boldsymbol b\ \ ] [  A   b  ] to [    I     x    ] [ \ \ I\ \ \ \boldsymbol x\ \ ] [  I   x  ] takes 62 operations.

Checkpoint:

Section 2.2 shows how to compute A – 1 B A^{–1}B A1B by row reduction. Describe how you could speed up this calculation if you have an LU factorization of A A A available (and A A A is invertible).

Answer:

  • If A A A is an invertible n × n n\times n n×n matrix, with an LU factorization A = L U A = LU A=LU, and if B B B is n × p n\times p n×p, then A – 1 B A^{–1}B A1B can be computed by first row reducing [    L     B    ] [\ \ L\ \ \ B\ \ ] [  L   B  ] to a matrix [    I     Y    ] [\ \ I\ \ \ Y\ \ ] [  I   Y  ] for some Y Y Y and then reducing [     U    Y     ] [\ \ \ U\ \ Y\ \ \ ] [   U  Y   ] to [    I     A – 1 B    ] [\ \ I\ \ \ A^{–1}B\ \ ] [  I   A1B  ].
  • MATLAB uses this approach to compute A – 1 B A^{–1}B A1B (after first finding L L L and U U U).

在这里插入图片描述

An LU Factorization Algorithm

  • At first, assume that A A A is an m × n m \times n m×n matrix that can be row reduced to echelon form, w i t h o u t   r o w   i n t e r c h a n g e s without\ row\ interchanges without row interchanges. (Later, we will treat the general case.)
  • In this case, there exist unit lower triangular elementary matrices E 1 , . . . , E p E_1,...,E_p E1,...,Ep such that
    E p . . . E 1 A = U        ( 3 ) E_p...E_1A=U\ \ \ \ \ \ (3) Ep...E1A=U      (3)Then
    A = ( E p . . . E 1 ) − 1 U = L U        ( 4 ) A=(E_p...E_1)^{-1}U=LU\ \ \ \ \ \ (4) A=(Ep...E1)1U=LU      (4)It can be shown that products and inverses of unit lower triangular matrices are also unit lower triangular. Thus L L L is unit lower triangular.

PROOF
Let A A A be a lower triangular n × n n \times n n×n matrix with nonzero entries on the diagonal. Show that A A A is invertible and A − 1 A^{-1} A1 is lower triangular.
[Hint: Explain why A A A can be changed into I I I using only row replacements and scaling. Also, explain why the row operations that reduce A A A to I I I change I I I into a lower triangular matrix.] 也可以用上一节介绍的分块矩阵+数学归纳法来证明


  • Note that the row operations in equation (3), which reduce A A A to U U U, also reduce the L L L in equation (4) to I I I. This observation is the key to constructing L L L.

在这里插入图片描述

Step 1 is not always possible, but when it is, the argument above shows that an LU factorization exists.


EXAMPLE 2

Find an LU factorization of
A = [ 2 4 − 1 5 − 2 − 4 − 5 3 − 8 1 2 − 5 − 4 1 8 − 6 0 7 − 3 1 ] A=\left[\begin{array}{rrrrr} 2 & 4 & -1 & 5 & -2 \\ -4 & -5 & 3 & -8 & 1 \\ 2 & -5 & -4 & 1 & 8 \\ -6 & 0 & 7 & -3 & 1 \end{array}\right] A=24264550134758132181

SOLUTION

  • Since A A A has four rows, L L L should be 4 × 4 4 \times 4 4×4. The first column of L L L is the first column of A A A divided by the top pivot entry:
    L = [ 1 0 0 0 − 2 1 0 0 1 1 0 − 3 1 ] L=\left[\begin{array}{rrrr} 1 & 0 & 0 & 0 \\ -2 & 1 & 0 & 0 \\ 1 & & 1 & 0 \\ -3 & & & 1 \end{array}\right] L=1213010010001Compare the first columns of A A A and L L L. The row operations that create zeros in the first column of A A A will also create zeros in the first column of L L L. To make this same correspondence of row operations on A A A hold for the rest of L L L, watch a row reduction of A A A to an echelon form U U U. That is, highlight the entries in each matrix that are used to determine the sequence of row operations that transform A A A into U U U.
    在这里插入图片描述The highlighted entries determine the row reduction of A A A to U U U. At each pivot column, divide the highlighted entries by the pivot and place the result into L L L:
    在这里插入图片描述

Permuted LU Factorizations

置换 LU 分解

  • In practical work, row interchanges are nearly always needed, because partial pivoting (部分主元法) is used for high accuracy. (Recall that this procedure selects, among the possible choices for a pivot, an entry in the column having the largest absolute value.)

Permuted LU Factorizations

  • Any m × n m\times n m×n matrix A A A admits a factorization A = L U A = LU A=LU, with U U U in echelon form and L L L a permuted unit lower triangular matrix.
    • That is, L L L is a matrix such that a permutation (rearrangement) of its rows (using row interchanges) will produce a lower triangular matrix with 1’s on the diagonal.

Permuted LU Factorizations Algorithm

  • To handle row interchanges, the construction of L L L and U U U depends on first using row replacements to reduce A A A to a permuted echelon form V V V and then using row interchanges to reduce V V V to an echelon form U U U.
    • By watching the reduction of A A A to V V V, we can easily construct a permuted unit lower triangular matrix L L L with the property that the sequence of operations changing A A A into U U U also changes L L L into I I I. This property will guarantee that A = L U A = LU A=LU.
  • The following algorithm reduces any matrix to a permuted echelon form. In the algorithm when a row is covered, we ignore it in later calculations.
    • (1) Begin with the leftmost nonzero column. Choose any nonzero entry as the pivot. Designate the corresponding row as a pivot row.
    • (2) Use row replacements to create zeros above and below the pivot (in all uncovered rows). Then cover that pivot row.
    • (3) Repeat steps 1 and 2 on the uncovered submatrix, if any, until all nonzero entries are covered.

Example 1

  • As an example, choose any entry in the first column of the following matrix as the first pivot, and use the pivot to create zeros in the rest of column 1. We choose the (3, 1)-entry.
    在这里插入图片描述Row 3 is the first pivot row. Choose the (2, 2)-entry as the second pivot, and create zeros in the rest of column 2, excluding the first pivot row.
    在这里插入图片描述Cover row 2 and choose the (4, 4)-entry as the pivot. Create zeros in the other rows, excluding the first two pivot rows.
    在这里插入图片描述
  • Let V V V denote this permuted echelon form, and permute the rows of V V V to create an echelon form. The resulting echelon matrix U U U is
    在这里插入图片描述
  • The last step is to create L L L. Go back and watch the reduction of A A A to V V V. As each pivot is selected, take the pivot column, and divide the pivot into each entry in the column that is not yet in a pivot row. Place the resulting column into L L L. At the end, fill the holes in L L L with zeros.
    在这里插入图片描述

Example 2

  • The next example illustrates what to do when V V V has one or more rows of zeros. For the reduction of A A A to V V V, pivots were chosen to have the largest possible magnitude (the choice used for “partial pivoting”).
    在这里插入图片描述
    The first three columns of L L L come from the three pivot columns above.
    在这里插入图片描述The matrix L L L needs two more columns. Use columns 1 and 3 of the 5 × 5 5\times5 5×5 identity matrix to place 1’s in the “nonpivot” rows 1 and 3. Fill in the remaining holes with zeros.
    在这里插入图片描述

A Matrix Factorization in Electrical Engineering

  • Matrix factorization is intimately related to the problem of constructing an electrical network with specified properties.

  • Suppose the box in Figure 3 represents some sort of electric circuit, with an input and output.
    在这里插入图片描述
  • Record the input voltage and current by [ v 1 i 1 ] \begin{bmatrix}v_1\\i_1\end{bmatrix} [v1i1] and record the output voltage and current by [ v 2 i 2 ] \begin{bmatrix}v_2\\i_2\end{bmatrix} [v2i2]. Frequently, the transformation [ v 1 i 1 ] ↦ [ v 2 i 2 ] \begin{bmatrix}v_1\\i_1\end{bmatrix}\mapsto\begin{bmatrix}v_2\\i_2\end{bmatrix} [v1i1][v2i2] is linear. That is, there is a matrix A A A, called the t r a n s f e r transfer transfer m a t r i x matrix matrix, such that
    [ v 2 i 2 ] = A [ v 1 i 1 ] \begin{bmatrix}v_2\\i_2\end{bmatrix}=A\begin{bmatrix}v_1\\i_1\end{bmatrix} [v2i2]=A[v1i1]
  • Figure 4 shows a l a d d e r   n e t w o r k ladder\ network ladder network. The left circuit in Figure 4 is called a s e r i e s   c i r c u i t ( 串 联 电 路 ) series\ circuit(串联电路) series circuit(), with resistance R 1 R_1 R1. The right circuit in Figure 4 is a s h u n t   c i r c u i t ( 并 联 电 路 ) shunt\ circuit(并联电路) shunt circuit(), with resistance R 2 R_2 R2.
    在这里插入图片描述
  • Using Ohm’s law and Kirchhoff’s laws, one can show that the transfer matrices of the series and shunt circuits, respectively, are
    在这里插入图片描述
  • A network transfer matrix summarizes the input–output behavior (the design specifications) of the network without reference to the interior circuits. To physically build a network with specified properties, an engineer first determines if such a network can be constructed (or realized). Then the engineer tries to factor the transfer matrix into matrices corresponding to smaller circuits that perhaps are already manufactured and ready for assembly. In the common case of alternating current (交流电), the entries in the transfer matrix are usually rational complex-valued functions. A standard problem is to find a minimal realization that uses the smallest number of electrical components.

EXAMPLE 3

  • a. Compute the transfer matrix of the ladder network in Figure 4.
  • b. Design a ladder network whose transfer matrix is [ 1 − 8 − . 5 5 ] \begin{bmatrix} 1&-8\\-.5&5 \end{bmatrix} [1.585].

SOLUTION

  • a. Let A 1 A_1 A1 and A 2 A_2 A2 be the transfer matrices of the series and shunt circuits, respectively. Then the transfer matrix of the ladder network corresponds to composition of linear transformations
    在这里插入图片描述
  • b. To factor the matrix [ 1 − 8 − . 5 5 ] \begin{bmatrix} 1&-8\\-.5&5 \end{bmatrix} [1.585] into the product of transfer matrices, as in equation
    (6), look for R 1 R_1 R1 and R 2 R_2 R2 in Figure 4 to satisfy
    在这里插入图片描述

The QR Factorization

QR 分解

  • Suppose A = Q R A = QR A=QR, where Q Q Q and R R R are n × n n \times n n×n. R R R is invertible and upper triangular, and Q Q Q has the property that Q T Q = I Q^TQ = I QTQ=I.
    • When A = Q R A =QR A=QR, the equation A x = b A\boldsymbol x = \boldsymbol b Ax=b can be written as Q ( R x ) = b Q(R\boldsymbol x)=\boldsymbol b Q(Rx)=b. Then R x = Q T b R\boldsymbol x=Q^T\boldsymbol b Rx=QTb, which is easy to solve. It can be seen that the equation A x = b A\boldsymbol x =\boldsymbol b Ax=b has a unique solution.
  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值