Chapter 7 annotated
1. Consistency of linear systems
This section explores the conditions under which a linear system of equations Axˉ=bˉ has solutions, introducing the concepts of consistency, inconsistency, and the least squares problem for systems that lack an exact solution.
1.1 Understanding system consistency
A linear system Axˉ=bˉ, where A is an M×N matrix, xˉ is an N×1 vector of unknowns, and bˉ is an M×1 vector of constants, can have no solution (inconsistent), exactly one solution, or infinitely many solutions. The determination of a system's consistency is fundamentally linked to the properties of the matrix A and the vector bˉ, particularly their relationship within the column space of A.
Gaussian elimination is a primary tool for analyzing the consistency of a linear system. By reducing the augmented matrix [A∣bˉ] to row echelon form, we can identify if a contradiction arises (e.g., a row of the form [00…0∣c] where c=0), which signifies an inconsistent system.
1.1.1 Inconsistent systems and the column space
A linear system Axˉ=bˉ is inconsistent if and only if the vector bˉ is not in the column space of A, denoted as Col(A). The column space of A is the set of all possible linear combinations of the columns of A. If bˉ∈Col(A), it implies that bˉ can be expressed as a linear combination of the columns of A, which corresponds to the existence of at least one solution xˉ to Axˉ=bˉ. Conversely, if bˉ∈/Col(A), no such linear combination exists, and the system has no solution.
Note: If a system is consistent, there is at least one vector xˉ such that Axˉ=bˉ. If bˉ is in the column space of A, then bˉ=Axˉ for some xˉ. This xˉ is a solution. .
Example: Consider a system where A is an M×N matrix with M≫N. This scenario often arises in applications where there are more equations than unknowns, potentially leading to an overdetermined system. Such a system is not necessarily inconsistent; its consistency still depends on whether bˉ lies within Col(A). 8.
1.2 The Least Squares Problem
When a linear system Axˉ=bˉ is inconsistent, we cannot find a vector xˉ that perfectly satisfies the equation. In such cases, the least squares problem seeks to find an approximation yˉ such that Ayˉ is as "close" as possible to bˉ. This is achieved by minimizing the Euclidean norm of the residual vector Ayˉ−bˉ:
minyˉ∥Ayˉ−bˉ∥
The vector yˉ that achieves this minimum is called the least squares solution. This problem is frequently encountered in practical applications where data may be noisy or a perfect fit is impossible, such as in curve fitting.
Reminder: The least squares problem is about finding the vector Ayˉ in Col(A) that is closest to bˉ. This closest vector is the orthogonal projection of bˉ onto Col(A). , 10 16.
1.2.1 Solving least squares via orthogonal projection
One method to find the least squares solution is by utilizing orthogonal projections. If we have an orthogonal basis {vˉ1,vˉ2,…,vˉk} for Col(A), the orthogonal projection of bˉ onto Col(A) is given by the sum of the projections of bˉ onto each basis vector:
projCol(A)(bˉ)=∑i=1kprojvˉi(bˉ)=∑i=1k∥vˉi∥2bˉ⋅vˉivˉi
The resulting vector projCol(A)(bˉ) is the vector in Col(A) closest to bˉ. If this projection is equal to Ayˉ, then yˉ is the least squares solution.
Example: For the system
110011xˉ=121An orthogonal basis for Col(A) is {vˉ1=(1,1,0),vˉ2=(−21,21,1)}. The projection of bˉ=(1,2,1) onto Col(A) is:
projvˉ1(bˉ)=∥(1,1,0)∥2(1,2,1)⋅(1,1,0)(1,1,0)=12+12+021+2(1,1,0)=23(1,1,0) projvˉ2(bˉ)=∥(−21,21,1)∥2(1,2,1)⋅(−21,21,1)(−21,21,1)=(−21)2+(21)2+12−21+1+1(−21,21,1)=41+41+123(−21,21,1)=2323(−21,21,1)=1⋅(−21,21,1)=(−21,21,1)The closest point in Col(A) is projCol(A)(bˉ)=23(1,1,0)+(−21,21,1)=(23−21,23+21,1)=(1,2,1). In this specific case, bˉ is already in Col(A), meaning the system is consistent and the least squares solution is the exact solution. However, if bˉ were not in Col(A), the sum of projections would yield the closest vector. , , 14 15.
1.2.2 Solving least squares with QR decomposition
The QR decomposition of a matrix A expresses A as a product of an orthogonal matrix Q and an upper triangular matrix R. If A=QR, where Q is an orthogonal matrix (meaning QTQ=I), the least squares problem can be simplified.
For a system Axˉ=bˉ, substituting A=QR gives QRxˉ=bˉ. Multiplying by QT (since QT=Q−1 for orthogonal matrices), we get Rxˉ=QTbˉ. This new system Rxˉ=QTbˉ has the same least squares solutions as the original system. Since R is upper triangular, this system can be solved efficiently using back substitution.
Note: When A=QR and Q is an orthogonal matrix (not necessarily orthonormal), the least squares solution yˉ can be found by solving Ryˉ=QTbˉ. If R is invertible, then yˉ=R−1QTbˉ. , , 18 20.
Important: The matrix A may not be invertible. If A is not invertible, its column space might not span the entire RM, and ATA might not be invertible. The QR decomposition can still be used, and if Q is chosen to be orthonormal, R will be upper triangular, and Rxˉ=QTbˉ provides the least squares solution. 19.
1.2.3 Solving least squares by the normal equation
A powerful and widely used method for solving the least squares problem is through the normal equation. For an inconsistent system Axˉ=bˉ, the least squares solution yˉ satisfies the equation:
ATAyˉ=ATbˉ
The matrix ATA is an N×N matrix. If A has linearly independent columns, then ATA is invertible, and the unique least squares solution is given by:
yˉ=(ATA)−1ATbˉ
The normal equation arises from the geometric condition that the residual vector (Ayˉ−bˉ) must be orthogonal to the column space of A. This means (Ayˉ−bˉ) is in the null space of AT. Thus, AT(Ayˉ−bˉ)=0ˉ, which simplifies to ATAyˉ=ATbˉ.
Important: The vector Ayˉ is the orthogonal projection of bˉ onto Col(A). The residual vector Ayˉ−bˉ is orthogonal to Col(A). , 22 23.
Tip: The normal equation approach is generally preferred when ATA is well-conditioned and invertible, as it provides a direct way to compute the least squares solution.
Example: Consider the system:
110011xˉ=121First, calculate ATA and ATbˉ:
AT=[101101] ATA=[101101]110011=[1+1111+1]=[2112] ATbˉ=[101101]121=[1+22+1]=[33]Now, solve the normal equation ATAyˉ=ATbˉ:
[2112]yˉ=[33]The inverse of ATA is (ATA)−1=−1[2−1−12]=31[2−1−12] 1 2. The least squares solution is:
yˉ=(ATA)−1ATbˉ=31[2−1−12][33]=31[6−3−3+6]=31[33]=[11]This solution yˉ=[11] matches the exact solution found earlier, as the original system was consistent. , 25 26.
Comparison of Errors: Consider the least squares solution yˉ=[11] and another potential solution zˉ=[−11.5] for the system above. The error for yˉ is Ayˉ−bˉ=110011[11]−121=121−121=000. The norm is ∥0∥=0. The error for zˉ is Azˉ−bˉ=110011[−11.5]−121=−10.51.5−121=−2−1.50.5. The norm is ∥Azˉ−bˉ∥=(−2)2+(−1.5)2+(0.5)2=4+2.25+0.25=6.5. The least squares solution yields the minimum possible error norm. 27.
2. Projection matrices and their properties
This section explores projection matrices as a tool for orthogonal projection onto vectors and column spaces, detailing their fundamental properties and equivalences, and subsequently applying these concepts to least squares methods for data fitting.
2.1 Orthogonal projection onto a vector
An orthogonal projection of a vector v onto a non-zero vector u can be represented by a projection matrix Pu. This matrix projects any vector v onto the line spanned by u. The projected vector is parallel to u, and its magnitude is determined by the angle and lengths of u and v.
The formula for the projection of v onto u is given by: projuv=∥u∥2v⋅uu When vectors are treated as column matrices, the projection matrix Pu is defined as: Pu=uTuuuT where uTu is the dot product (or squared norm) of u, and uuT is the outer product.
Example: Calculate the projection matrix for u=1/21/21. First, calculate uTu: uTu=(1/21/21)1/21/21=(1/2)(1/2)+(1/2)(1/2)+=1/4+1/4+1=1.5 1. Next, calculate the outer product uuT: uuT=1/21/21(1/21/21)=1/41/41/21/41/41/21/21/21 Finally, the projection matrix is: Pu=1.511/41/41/21/41/41/21/21/21=321/41/41/21/41/41/21/21/21=1/61/61/31/61/61/31/31/32/3
2.2 Projection onto a column space
The concept of projection extends to projecting a vector onto the column space of a matrix A, denoted as Col(A). This projection is crucial for solving systems of linear equations that may not have an exact solution, such as in least squares problems.
The projection matrix P onto the column space of A, denoted as PCol(A), is given by: P=A(ATA)−1AT This formula is valid provided that the matrix ATA is invertible.
Note: The term (ATA)−1AT is often referred to as the Moore-Penrose pseudoinverse of A when A has full column rank.
2.3 Properties and equivalences of projection matrices
For a given matrix A, the following properties are equivalent, particularly when A has linearly independent columns:
- The linear system Ax=b has a unique least squares solution for all vectors b.
- The columns of A are linearly independent.
- The matrix ATA is invertible.
These equivalences are fundamental to understanding the conditions under which least squares solutions are well-defined and unique.
Proof of Equivalences:
- 1 ⟹ 2: If Ax=b has a unique solution for all b, it implies that the null space of A contains only the zero vector. If the null space contains only 0, then the columns of A must be linearly independent.
- 2 ⟹ 3: If the columns of A are linearly independent, then ATA is a square matrix that is also invertible. To show this, assume ATAx=0. Then (Ax)T(Ax)=xTATAx=0. This implies Ax=0. Since the columns of A are linearly independent, the only solution is x=0. Therefore, ATA is invertible.
- 3 ⟹ 1: If ATA is invertible, then the normal equation ATAx=ATb has a unique solution for x, given by x=(ATA)−1ATb. This unique solution is the least squares solution for Ax=b.
Important: These equivalences hold when A has full column rank (i.e., its columns are linearly independent). If A does not have full column rank, ATA is not invertible, and the system Ax=b may have infinitely many solutions or no exact solution, and the least squares solution may not be unique.
2.4 Least squares for curve fitting
Least squares methods are widely applied in experimental sciences to fit models to data, especially when direct solutions are not possible due to noise or model inaccuracies. The goal is to find the parameters that minimize the sum of squared differences between the observed data and the model's predictions.
2.4.1 Fitting linear equations
When fitting a linear model of the form y=ϵ1x1+ϵ2x2+⋯+ϵnxn, where ϵi are parameters to be estimated and xi are independent variables, we can express this in matrix form. For experimental data, this typically leads to an overdetermined system.
In a real experiment, the measured y values will not perfectly satisfy the linear dependency law due to experimental noise or inaccuracies in the hypothesized model. The least squares approach seeks to find the parameter values that best approximate the relationship.
Example: Fit a least-squares line for the data: x: 1.1, 1.9, 3.2, 4.2 y: 0.7, 1.2, 1.5, 2.2 For the hypothesized relationship ϵ0+ϵ1x=y. This can be written in matrix form: 11111.11.93.24.2(ϵ0ϵ1)=0.71.21.52.2 Here, A=11111.11.93.24.2, x=(ϵ0ϵ1), and b=0.71.21.52.2. The least squares solution is found by solving ATAx=ATb.
2.4.2 Fitting non-linear equations
Even if the relationship between variables is non-linear, a curve can still be fitted using least squares, provided the relationship is linear in the parameters. This is achieved by constructing a design matrix where columns represent functions of the independent variables.
Example: Fit a linear model for the data with the hypothesized relationship y=ϵ0x+ϵ1e−x. x: 0.5, 1.0, 1.5, 2.0 y: 11.6, 7.50, 4.47, 3.34
First, we need to compute the values for the term e−x: e−x: 0.61, 0.37, 0.22, 0.14 (approximately)
The design matrix A is formed by columns corresponding to the terms multiplying the parameters ϵ0 and ϵ1: A=x1x2x3x4e−x1e−x2e−x3e−x4=0.51.01.52.00.610.370.220.14 The vector of observed values is: b=11.67.504.473.34 The parameter vector is ϵ=(ϵ0ϵ1). The problem then reduces to solving the least squares system Aϵ=b by solving the normal equations ATAϵ=ATb.
This approach allows for fitting complex models by transforming them into a form that is linear in the parameters, thereby enabling the application of powerful linear algebra techniques.
Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
© 2026 Maeve. All rights reserved. This content is protected by copyright.