本文为《Linear algebra and its applications》的读书笔记
目录
A of a matrix is an equation that expresses as a product of two or more matrices. Whereas matrix multiplication involves a of data (数据的综合) (combining the effects of two or more linear transformations into a single matrix). In the language of computer science, the expression of as a product amounts to a preprocessing of the data in , 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分解
The LU factorization is motivated by the fairly common industrial and business problem of solving a sequence of equations, all with the same coefficient matrix:
When is invertible, one could compute and then compute , , and so on. However, it is more efficient to solve the first equation in sequence (1) by row reduction and obtain an LU factorization of at the same time. Thereafter, the remaining equations in sequence (1) are solved with the LU factorization.
At first, assume that is an matrix that can be row reduced to echelon form, . (Later, we will treat the general case.) Then can be written in the form , where is an lower triangular matrix with 1’s on the diagonal and is an echelon form of . For instance, see Figure 1. Such a factorization is called an factorization of . The matrix is invertible and is called a lower triangular matrix(单位下三角矩阵).
Before studying how to construct and , we should look at why they are so useful. When , the equation can be written as . Writing for , we can find by solving the pair of equations
First solve for ; and then solve for . See Figure 2. Each equation is easy to solve because and are triangular.
EXAMPLE 1
It can be verified that
Use this LU factorization of to solve , where .
SOLUTION The solution of needs only 6 multiplications and 6 additions.
Then, for , 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 requires 28 arithmetic operations, or “flops” (floating point operations), excluding the cost of finding and . In contrast, row reduction of to takes 62 operations.
Checkpoint: Section 2.2 shows how to compute by row reduction. Describe how you could speed up this calculation if you have an LU factorization of available (and is invertible).
Answer: If is an invertible matrix, with an LU factorization , and if is , then can be computed by first row reducing to a matrix for some and then reducing to . MATLAB uses this approach to compute (after first finding L and U).
EXAMPLE
When is invertible, MATLAB finds by factoring (where may be permuted lower triangular), inverting and , and then computing .
An LU Factorization Algorithm
Suppose can be reduced to an echelon form using only row replacements that add a multiple of one row to another row below it. In this case, there exist unit lower triangular elementary matrices such that
Then
It can be shown that products and inverses of unit lower triangular matrices are also unit lower triangular. Thus is unit lower triangular.
PROOF
Let be a lower triangular matrix with nonzero entries on the diagonal. Show that is invertible and is lower triangular.
[Hint: Explain why can be changed into using only row replacements and scaling. Also, explain why the row operations that reduce to change into a lower triangular matrix.] 也可以用上一节介绍的分块矩阵+数学归纳法来证明
Note that the row operations in equation (3), which reduce to , also reduce the in equation (4) to . This observation is the key to constructing .
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
SOLUTION
Since has four rows, should be . The first column of is the first column of divided by the top pivot entry:
Compare the first columns of and . The row operations that create zeros in the first column of will also create zeros in the first column of . To make this same correspondence of row operations on hold for the rest of , watch a row reduction of to an echelon form . That is, highlight the entries in each matrix that are used to determine the sequence of row operations that transform into .
The highlighted entries determine the row reduction of to . At each pivot column, divide the highlighted entries by the pivot and place the result into :
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.)
To handle row interchanges, the LU factorization above can be modified easily to produce an that is (置换下三角矩阵), in the sense that a rearrangement (called a permutation) of the rows of can make (unit) lower triangular.
The resulting (置换LU分解) solves in the same way as before, except that the reduction of to follows the order of the pivots in from left to right, starting with the pivot in the first column. A reference to an “LU factorization” usually includes the possibility that might be permuted lower triangular. For details, see the Appendix.
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 and record the output voltage and current by . Frequently, the transformation is linear. That is, there is a matrix , called the , such that
Figure 4 shows a . The left circuit in Figure 4 is called a , with resistance .
The right circuit in Figure 4 is a , with resistance . Using Ohm’s law and Kirchhoff’s laws, one can show that the transfer matrices of the series and shunt circuits, respectively, are
EXAMPLE 3
a. Compute the transfer matrix of the ladder network in Figure 4.
b. Design a ladder network whose transfer matrix is .
SOLUTION
a. Let and 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 into the product of transfer matrices, as in equation
(6), look for and in Figure 4 to satisfy
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.
The QR Factorization QR分解
Suppose ; where and are . is invertible and upper triangular, and has the property that . It can be shown that for each in , the equation has a unique solution.
When , the equation can be written as . Then , which is easy to solve.
Appendix: Permuted LU Factorizations 置换LU分解
Any matrix admits a factorization , with in echelon form and a permuted unit lower triangular matrix. That is, 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.
The construction of and , illustrated below, depends on first using row replacements to reduce to a permuted echelon form and then using row interchanges to reduce to an echelon form . By watching the reduction of to , we can easily construct a permuted unit lower triangular matrix with the property that the sequence of operations changing into also changes into . This property will guarantee that .
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.
- Begin with the leftmost nonzero column. Choose any nonzero entry as the pivot. Designate the corresponding row as a pivot row.
- Use row replacements to create zeros above and below the pivot (in all uncovered rows). Then cover that pivot row.
- Repeat steps 1 and 2 on the uncovered submatrix, if any, until all nonzero entries are
covered.
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 denote this permuted echelon form, and permute the rows of to create an echelon form. The resulting echelon matrix is
The last step is to create . Go back and watch the reduction of to . 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 . At the end, fill the holes in with zeros.
The next example illustrates what to do when has one or more rows of zeros. For the reduction of to , pivots were chosen to have the largest possible magnitude (the choice used for “partial pivoting”).
The first three columns of come from the three pivot columns above.
The matrix needs two more columns. Use columns 1 and 3 of the identity matrix to place 1’s in the “nonpivot” rows 1 and 3. Fill in the remaining holes with zeros.