Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Economics

2 Vector Spaces

National Graduate Institute for Policy Studies (GRIPS)

Our first technical topic for this book is linear algebra, which is one of the foundation stones of applied mathematics in general, and econometrics and statistics in particular. Data ordered by observation are naturally stored in vectors. Related vectors are naturally grouped into matrices. Once our data are organized this way, we need to perform basic arithmetic operations or solve equations or quadratic minimization problems. In this chapter we cover the foundations of vector operations used in linear algebra. As we’ll see, the conceptual aspects of linear algebra are clearest if we begin by stripping away details such as matrices and look instead at linear operations from a more abstract perspective.

2.1Vectors and Vector Space

Let’s begin with vector space and basic vector operations.

2.1.1Vectors

For arbitrary N∈NN \in \NN, the symbol RN\RR^N represents the set of all NN-vectors, or vectors of length NN. A typical element has the form

x=(x1x2⋮xN) where xn∈R for each n\boldx = \left( \begin{array}{c} x_1 \\ x_2 \\ \vdots \\ x_N \end{array} \right) \quad \text{ where } x_n \in \RR \text{ for each } n

(R=R1\RR = \RR^1 represents the set of all real numbers, which is the union of the rational and irrational numbers.) While x\boldx has been written vertically, as a column of numbers, we could also write it horizontally as x=(x1,…,xN)\boldx = (x_1, \ldots, x_N). For now vectors are just a sequences of numbers, and it makes no difference whether we write them vertically or horizontally. (Only when we work with matrix multiplication does it become necessary to distinguish between column and row vectors.)

The vector of ones will be denoted 1\boldone and the vector of zeros will be denoted 0\boldzero:

1:=(1⋮1),0:=(0⋮0)\boldone := \left( \begin{array}{c} 1 \\ \vdots \\ 1 \end{array} \right), \quad \quad \boldzero := \left( \begin{array}{c} 0 \\ \vdots \\ 0 \end{array} \right)

Although vectors are infinitesimal points in RN\RR^N, they are often represented visually as arrows from the origin to the point itself. Figure 2.1 gives an illustration for the case N=2N=2.

Three vectors in \RR^2

Figure 2.1:Three vectors in R2\RR^2

In vector space theory there are two fundamental algebraic operations: vector addition and scalar multiplication. For x,y∈RN\boldx, \boldy \in \RR^N, their vector sum is

x+y=(x1⋮xN)+(y1⋮yN):=(x1+y1⋮xN+yN)\boldx + \boldy = \left( \begin{array}{c} x_1 \\ \vdots \\ x_N \end{array} \right) + \left( \begin{array}{c} y_1 \\ \vdots \\ y_N \end{array} \right) := \left( \begin{array}{c} x_1 + y_1 \\ \vdots \\ x_N + y_N \end{array} \right)

If α∈R\alpha \in \RR, then the scalar product of α\alpha and x\boldx is defined to be

αx=α(x1⋮xN):=(αx1⋮αxN)\alpha \boldx = \alpha \left( \begin{array}{c} x_1 \\ \vdots \\ x_N \end{array} \right) := \left( \begin{array}{c} \alpha x_1 \\ \vdots \\ \alpha x_N \end{array} \right)

Thus addition and scalar multiplication are defined in terms of ordinary addition and multiplication in R\RR, computed element by element, adding and multiplying respectively.[1] Figure 2.2 and Figure 2.3 show examples of vector addition and scalar multiplication in the case N=2N=2.

Vector addition

Figure 2.2:Vector addition

Scalar multiplication

Figure 2.3:Scalar multiplication

Subtraction of two vectors is performed element by element, just like addition. Subtraction is not a primitive operation because the definition can be given in terms of addition and scalar multiplication: x−y:=x+(−1)y\boldx - \boldy := \boldx + (-1) \boldy. An illustration of subtraction is given in figure 2.4. One way to remember this operation is to draw a line from y\boldy to x\boldx and then shift it to the origin.

Difference between vectors

Figure 2.4:Difference between vectors

The inner product of two vectors x\boldx and y\boldy in RN\RR^N is denoted by ⟨x,y⟩\inner{\boldx, \boldy}, and defined as the sum of the products of their elements:

⟨x,y⟩:=∑n=1Nxnyn\inner{\boldx, \boldy} := \sum_{n=1}^N x_n y_n

These properties are easy to check from (2.1). For example, regarding the second equality, pick any α,β∈R\alpha, \beta \in \RR and any x,y∈RN\boldx, \boldy \in \RR^N. By the definitions of scalar multiplication and inner product respectively, we have

⟨αx,βy⟩=∑n=1Nαxnβyn=αβ∑n=1Nxnyn=αβ⟨x,y⟩\inner{\alpha \boldx, \beta \boldy} = \sum_{n=1}^N \alpha x_n \beta y_n = \alpha \beta \sum_{n=1}^N x_n y_n = \alpha \beta \inner{\boldx, \boldy}

The (Euclidean) norm of a vector x∈RN\boldx \in \RR^N is defined as

∥x∥:=⟨x,x⟩\| \boldx \| := \sqrt{\inner{\boldx, \boldx}}

and represents the length of the vector x\boldx. (In the arrow representation of vectors in figures 2.2–2.4, the norm of the vector is equal to the length of the arrow.)

Properties (i) and (ii) you can verify yourself without difficulty. Proofs for (iii) and (iv) are a bit harder. Property (iii) is called the triangle inequality, while (iv) is called the Cauchy–Schwarz inequality. The proof of the Cauchy–Schwarz inequality is given as a solved exercise after we’ve built up some more tools (see ex. 3.5.33). If you’re prepared to accept the Cauchy–Schwarz inequality for now, then the triangle inequality follows, because, by the properties of the inner product given in fact 2.1.1,

∥x+y∥2=⟨x+y,x+y⟩=⟨x,x⟩+2⟨x,y⟩+⟨y,y⟩⩽⟨x,x⟩+2∣ ⁣⟨x,y⟩ ⁣∣+⟨y,y⟩\| \boldx + \boldy \|^2 = \inner{\boldx + \boldy, \boldx + \boldy} = \inner{\boldx, \boldx} + 2 \inner{\boldx, \boldy} + \inner{\boldy, \boldy} \leq \inner{\boldx, \boldx} + 2 | \! \inner{\boldx, \boldy} \! | + \inner{\boldy, \boldy}

Applying the Cauchy–Schwarz inequality leads to ∥x+y∥2⩽(∥x∥+∥y∥)2\| \boldx + \boldy \|^2 \leq ( \| \boldx \| + \| \boldy\|)^2. Taking the square root gives the triangle inequality.

Given two vectors x\boldx and y\boldy, the value ∥x−y∥\| \boldx - \boldy \| has the interpretation of being the “distance” between these points. To see why, consult figure 2.4 again.

2.1.2Linear Combinations and Span

One of the most elementary ways to work with vectors is to combine them using linear operations. Given vectors x1,…,xK\boldx_1,\ldots, \boldx_K in RN\RR^N, a linear combination of these vectors is a new vector of the form

y=∑k=1Kαkxk=α1x1+⋯+αKxK\boldy = \sum_{k=1}^K \alpha_k \boldx_k = \alpha_1 \boldx_1 + \cdots + \alpha_K \boldx_K

for some collection of scalars α1,…,αK\alpha_1,\ldots, \alpha_K (i.e., with αk∈R\alpha_k \in \RR for all kk). Figure 2.5 shows four different linear combinations y=α1x1+α2x2\boldy = \alpha_1 \boldx_1 + \alpha_2 \boldx_2 where x1,x2\boldx_1, \boldx_2 are fixed vectors in R2\RR^2 and the scalars α1\alpha_1 and α2\alpha_2 are varied.

Linear combinations of \boldx_1, \boldx_2

Figure 2.5:Linear combinations of x1,x2\boldx_1, \boldx_2

Given any nonempty X⊂RNX \subset \RR^N, the set of all vectors that can be made by (finite) linear combinations of elements of XX is called the span of XX, and denoted by span⁡X\Span X. For example, the set of all linear combinations of X:={x1,…,xK}X := \{\boldx_1,\ldots, \boldx_K\} is

span⁡X:={ all vectors ∑k=1Kαkxk such that α:=(α1,…,αK)∈RK}\Span X:= \left\{ \text{ all vectors } \sum_{k=1}^K \alpha_k \boldx_k \text{ such that } \boldalpha := (\alpha_1,\ldots, \alpha_K) \in \RR^K \right\}

As will be discussed below, the span of certain collections of vectors turns out to have an intimate connection with existence of solutions to linear equations.

Span of X = \{\boldx_1, \boldx_2\}

Figure 2.6:Span of X={x1,x2}X = \{\boldx_1, \boldx_2\}

Canonical basis vectors in \RR^2

Figure 2.7:Canonical basis vectors in R2\RR^2

The next fact follows directly from the definition of span.

2.1.3Linear Independence

Linear independence is an apparently simple concept with implications that stretch deep into many aspects of analysis. If you wish to understand when a matrix is invertible, or when a system of linear equations has a unique solution, or when a least squares estimate is uniquely defined, the most important foundational idea is linear independence of vectors.

Let’s begin with the definition. Consider a set of vectors X:={x1,…,xK}X := \{\boldx_1,\ldots, \boldx_K\}. We can surely realize the origin 0\boldzero as a linear combination of these vectors, just by setting all of the scalars αk\alpha_k in ∑k=1Kαkxk\sum_{k=1}^K \alpha_k \boldx_k to zero. The set XX is called linearly independent when this is the only possibility. That is, X⊂RNX \subset \RR^N is called linearly independent if

α1x1+⋯+αKxK=0  ⟹  α1=⋯=αK=0\alpha_1 \boldx_1 + \cdots + \alpha_K \boldx_K = \boldzero \quad \implies \quad \alpha_1 = \cdots = \alpha_K = 0

We call XX linearly dependent if it is not linearly independent.

The only solution is \alpha_1 = \alpha_2 = 0

Figure 2.8:The only solution is α1=α2=0\alpha_1 = \alpha_2 = 0

How can we interpret linear independence? One way to understand it is as an indicator of the algebraic diversity of a given collection of vectors. In particular, in a linearly independent set, the span is relatively large, in the sense that every vector contributes to the span. Here’s a formal statement of this idea.

Exercise 2.4.15 asks you to check these equivalences. For now let’s just step through them in the context of two examples. First consider the pair of canonical basis vectors {e1,e2}\{\bolde_1, \bolde_2\} in R2\RR^2, as depicted in figure 2.7. As we saw in examples 2.1.4 and 2.1.7, this pair is linearly independent, and its span is all of R2\RR^2. Both vectors contribute to the span, since removing either one reduces the span to just a line in R2\RR^2. (For example, the span of {e1}\{\bolde_1\} is just the horizontal axis in R2\RR^2.) Neither one of this pair can be written as a linear combination of the other.

Next, consider instead the pair {x1,x2}\{\boldx_1, \boldx_2\} in example 2.1.8. These vectors fail to be linearly independent, as shown in that example. It is also clear that dropping either one does not change the span—it remains the horizontal axis in any case. Finally, we saw in example 2.1.8 that x2=−2x1\boldx_2 = -2 \boldx_1, which means that each vector can be written as a linear combination of the other.

The proof is a solved exercise (ex. 2.4.16).

2.1.3.1Linear Independence and Uniqueness

As we’ll see below, the problem of existence of solutions to systems of linear equations comes down to whether or not a given point is contained in the span of a collection of vectors (which typically correspond to the columns of a matrix). This depends in general on the size of the span, and the size of the span in turn depends on whether or not the vectors are linearly independent.

Given that linear independence is the key condition for existence of solutions, it’s surprising at first to learn that linear independence is the key condition for uniqueness as well. As we’ll see, the connection between linear independence and uniqueness stems from the following result.

2.1.4Linear Subspaces

We will find it rewarding to study more closely the structure of spans generated by a collection of vectors. One of the defining features of the span of a set XX is that it is “closed” under the linear operations of vector addition and scalar multiplication, in the sense that

  1. x,y∈span⁡X    ⟹    x+y∈span⁡X\boldx, \boldy \in \Span X \; \implies \; \boldx + \boldy \in \Span X, and

  2. y∈span⁡X\boldy \in \Span X and γ∈R    ⟹    γy∈span⁡X\gamma \in \RR \; \implies \; \gamma \boldy \in \Span X.

For example, (i) holds because the sum of two linear combinations of elements of XX is another linear combination of elements of XX.

The notion of a set being closed under scalar multiplication and vector addition is important enough to have its own name: A nonempty subset SS of RN\RR^N is called a linear subspace (or just subspace) of RN\RR^N if

x, y∈S and α, β∈R    ⟹    αx+βy∈S\boldx, \, \boldy \in S \text{ and } \alpha, \, \beta \in \RR \; \implies \; \alpha \boldx + \beta \boldy \in S

To visualize subspaces in R3\RR^3, think of lines and planes that pass through the origin. Here are some elementary facts about linear subspaces:

There’s also one deep result about linear subspaces we need to cover, which forms a cornerstone of many foundational results:

In other words, if there exists a set X={x1,…,xK}X = \{\boldx_1, \ldots, \boldx_K\} with S⊂span⁡XS \subset \Span X, then any subset of SS with more than KK vectors will be linearly dependent. The proof can be found in most texts on linear algebra (e.g., §3.5 of Jänich (1994)).

Any three vectors in P are linearly dependent

Figure 2.9:Any three vectors in PP are linearly dependent

2.1.5Bases and Dimension

Consider again the pair x1,x2\boldx_1, \boldx_2 shown in figure 2.5, and the four different vectors labeled y\boldy that we created from x1,x2\boldx_1, \boldx_2 by way of linear combinations. Eyeballing the figure gives the impression that any y∈R2\boldy \in \RR^2 could be constructed as a linear combination of x1,x2\boldx_1, \boldx_2 with suitable choice of the scalars α1,α2\alpha_1, \alpha_2. Indeed this is true. The reason is that the pair {x1,x2}\{\boldx_1, \boldx_2\} is linearly independent (see example 2.1.6), and any pair of linearly independent vectors in R2\RR^2 spans R2\RR^2. Here’s a statement of this result for the general case:

We now come to a key definition. Let SS be a linear subspace of RN\RR^N and let B⊂SB \subset S. The set BB is called a basis of SS if

  1. BB spans SS and

  2. BB is linearly independent.

The plural of basis is bases. In view of theorem 2.1.2, when BB is a basis of SS, each point in SS has exactly one representation as a linear combination of elements of BB.

It follows immediately from theorem 2.1.4 that any NN linearly independent vectors in RN\RR^N form a basis of RN\RR^N.

Here are the two most fundamental results about bases:

The proof of part (i) is not particularly hard. See, for example, section 3.2 of Jänich (1994). Part (ii) follows from theorem 2.1.3 and is left as an exercise (ex. 2.4.17).

If SS is a linear subspace of RN\RR^N, then the common number identified in theorem 2.1.5 is called the dimension of SS, and written as dim⁡S\dim S.

In RN\RR^N the singleton subspace {0}\{\boldzero\} is said to have zero dimension.

If we take a set of KK vectors, then how large will its span be in terms of dimension? The next theorem answers this question.

Exercise 2.4.19 asks you to prove these results.

Let’s finish this section with facts that can be deduced from the preceding results.

Part (i) of fact 2.1.6 implies that the only NN-dimensional linear subspace of RN\RR^N is RN\RR^N itself.

2.1.6Linear Maps

The single most important class of functions in applied mathematics is the linear functions. In high school we are told that linear functions as those whose graph is a straight line. Here’s a better definition: A function T ⁣:RK→RNT \colon \RR^K \to \RR^N is linear if

T(αx+βy)=αTx+βTy   for any x,y∈RK and α,β∈RT(\alpha \boldx + \beta \boldy) = \alpha T\boldx + \beta T\boldy \; \text{ for any } \boldx, \boldy \in \RR^K \text{ and } \alpha, \beta \in \RR

(Following a common convention, we’ll write linear functions with uppercase letters and omit the parenthesis around the argument where no confusion arises. This convention has come about because the action of linear maps is essentially isomorphic to multiplication of vectors by matrices. More on that topic soon.)

The definition in (2.7) tells us directly that if TT is linear then the exchange of order in T[∑k=1Kαkxk]=∑k=1KαkTxkT [ \sum_{k=1}^K \alpha_k \boldx_k ] = \sum_{k=1}^K \alpha_k T \boldx_k will be valid whenever K=2K=2. A simple inductive argument extends this to arbitrary KK. As an application of this fact, consider the following: As discussed in example 2.1.4, any x∈RK\boldx \in \RR^K can be expressed in terms of the basis vectors as ∑k=1Kαkek\sum_{k=1}^K \alpha_k \bolde_k, for some suitable choice of scalars. Hence, for a linear function TT, its range, denoted rng⁡T\range T, is the set of all points of the form

Tx=T[∑k=1Kαkek]=∑k=1KαkTekT\boldx = T \left[ \sum_{k=1}^K \alpha_k \bolde_k \right] = \sum_{k=1}^K \alpha_k T \bolde_k

as we vary α1,…,αK\alpha_1, \ldots, \alpha_K over all scalar combinations. (See Section 15.2 for the definition of range.) In other words, the range of a linear map is the span of the image of the canonical basis functions. This will prove to be important later on. The next fact summarizes.

Soon we’ll turn to the topic of determining when linear functions are bijections, an issue that is intimately related to invertibility of matrices. To this end it’s useful to note that, for linear functions, the property of being one-to-one can be determined by examining the set of points it maps to the origin. To express this idea, for any T ⁣:RK→RNT \colon \RR^K \to \RR^N, we define the null space or kernel of TT as

null⁡T:={x∈RK:Tx=0}\kernel T := \setntn{\boldx \in \RR^K}{T\boldx = \boldzero}

The proofs are straightforward. For example, if Tx=TyT\boldx = T\boldy for some x,y∈RK\boldx, \boldy \in \RR^K, then T(x−y)=0T(\boldx - \boldy) = \boldzero, and hence x−y∈null⁡T\boldx - \boldy \in \kernel T. So if null⁡T={0}\kernel T = \{\boldzero\}, then Tx=TyT\boldx = T\boldy implies x=y\boldx = \boldy, which means that TT is one-to-one.

2.1.7Linear Independence and Bijections

Many statistical problems are "inverse" problems, in the sense that we observe outcomes and wish to determine what generated them. For example, we might want to know what consumer preferences led to observed market behavior, or what kinds of expectations led to a given shift in exchange rates.

Inverse problem

Figure 2.10:Inverse problem

Consider the generic inverse problem in figure 2.10, where FF and yy are given, and we seek to obtain the unknown object xx. Two immediate questions are: Does this problem have a solution? and Is it unique? To provide general answers to these questions, we need to know whether FF is one-to-one, onto, etc. (see Section 15.2 for definitions and further discussion). The best case is when FF is a bijection, for then we know that a unique solution xx exists for every possible yy.

In general, functions can be onto, one-to-one, bijections, or none of the above. However, for linear functions from RN\RR^N to RN\RR^N, the first three properties are all equivalent! The next theorem gives details.

If any one of these conditions is true, then TT is called nonsingular. (Equivalently, a nonsingular function is a linear bijection.) Otherwise TT is called singular. The proof of theorem 2.1.7 is a solved exercise (ex. 2.4.21). Figure 2.11 provides intuition for the case of N=1N=1. In the top panel all conditions in theorem 2.1.7 are satisfied. In the lower panel none are. In particular, we can see that the condition for TT to be one-to-one and onto is exactly the same (i.e., α≠0\alpha \neq 0).

The case of N=1, nonsingular and singular

Figure 2.11:The case of N=1N=1, nonsingular and singular

If TT is nonsingular, then, being a bijection, it must have an inverse function T−1T^{-1} that is also a bijection (fact 15.2.1). It turns out that this inverse function inherits the linearity of TT (see ex. 2.4.20). In summary,

Theorem 2.1.7 only applies to linear maps between spaces of the same dimension. When linear functions map across distinct dimensions the situation changes:

The most important implication is that if N≠KN \neq K, then we can forget about bijections. The proof of theorem 2.1.8 is a solved exercise (ex. 2.4.22).

2.2Orthogonality

One of the core concepts in this book is orthogonality, not just of vectors but also of more complex objects such as random variables. Let’s begin with the vector definition and some key implications.

2.2.1Definition and Basic Properties

Let x\boldx and z\boldz be vectors in RN\RR^N. If ⟨x,z⟩=0\inner{\boldx, \boldz} = 0, then we write x⊥z\boldx \perp \boldz and call x\boldx and z\boldz orthogonal. In R2\RR^2, x\boldx and z\boldz are orthogonal when they are perpendicular to one another, as in figure 2.12. For x∈RN\boldx \in \RR^N and S⊂RNS \subset \RR^N, we say that x\boldx is orthogonal to SS if x⊥z\boldx \perp \boldz for all z∈S\boldz \in S (figure 2.13), and we write x⊥S\boldx \perp S. A set of vectors {z1,…,zK}⊂RN\{\boldz_1, \ldots, \boldz_K\} \subset \RR^N is called an orthogonal set if its elements are mutually orthogonal, that is, if zj⊥zk\boldz_j \perp \boldz_k whenever jj and kk are distinct.

\boldx \perp \boldz

Figure 2.12:x⊥z\boldx \perp \boldz

\boldx \perp S

Figure 2.13:x⊥S\boldx \perp S

Orthogonal sets and linear independence are closely related. For example,

While not every linearly independent set is orthogonal, an important partial converse to fact 2.2.2 is given in Section 2.2.4.

An orthogonal set O⊂RNO \subset \RR^N is called an orthonormal set if ∥u∥=1\| \boldu \| = 1 for all u∈O\boldu \in O. An orthonormal set that lies in and spans a linear subspace SS of RN\RR^N is called an orthonormal basis of SS. It is, necessarily, a basis of SS. (Why?) The standard example of an orthonormal basis for all of RN\RR^N is the canonical basis {e1,…,eN}\{\bolde_1, \ldots, \bolde_N\}.

By definition, if O={u1,…,uK}O = \{\boldu_1, \ldots, \boldu_K\} is any basis of SS, then, for any x∈S\boldx \in S, we can find unique scalars α1,…,αK\alpha_1, \ldots, \alpha_K such that x=∑k=1Kαkuk\boldx = \sum_{k=1}^K \alpha_k \boldu_k. While the values of these scalars are not always transparent, for an orthonormal basis they are easy to compute:

The proof is an exercise. Given S⊂RNS \subset \RR^N, the orthogonal complement of SS is defined as

S⊥:={x∈RN:x⊥S}S^{\perp} := \setntn{\boldx \in \RR^N}{\boldx \perp S}

Figure 2.14 gives an example in R2\RR^2.

Orthogonal complement of S

Figure 2.14:Orthogonal complement of SS

Indeed, if x,y∈S⊥\boldx, \boldy \in S^{\perp} and α,β∈R\alpha, \beta \in \RR, then αx+βy∈S⊥\alpha \boldx + \beta \boldy \in S^{\perp} because, for any z∈S\boldz \in S,

⟨αx+βy,z⟩=α⟨x,z⟩+β⟨y,z⟩=α×0+β×0=0\inner{\alpha \boldx + \beta \boldy, \boldz} = \alpha \inner{ \boldx, \boldz} + \beta \inner{\boldy, \boldz} = \alpha \times 0 + \beta \times 0 = 0

2.2.2The Orthogonal Projection Theorem

A central problem in linear regression and many other applications is approximation of some y\boldy of RN\RR^N by an element of a given subspace SS of RN\RR^N. Stated more precisely, the problem is, given y\boldy and SS, to find the closest element y^\hat \boldy of SS to y\boldy. Closeness is in terms of Euclidean norm, so y^\hat \boldy is the minimizer of ∥y−z∥\| \boldy - \boldz \| over all z∈S\boldz \in S:

y^=argmin⁡z∈S∥y−z∥\hboldy = \argmin_{\boldz \in S} \|\boldy - \boldz\|

The next theorem tells us that a solution y^\hboldy to this minimization problem always exists, as well as providing a means to identify it.

The intuition is easy to grasp from a graphical presentation. Figure 2.15 illustrates. Looking at the figure, we can see that the closest point to y\boldy in SS is the one point y^∈S\hboldy \in S such that y−y^\boldy - \hboldy is orthogonal to SS.

For a full proof see, for example, theorem 5.16 of Çinlar & Vanderbei (2013). Let’s just cover sufficiency of the conditions in part (ii): Let y∈RN\boldy \in \RR^N and let SS be a linear subspace of RN\RR^N. Let y^\hat \boldy be a vector in SS satisfying y−y^⊥S\boldy - \hat \boldy \perp S. Let z\boldz be any other point in SS. We have

∥y−z∥2=∥(y−y^)+(y^−z)∥2=∥y−y^∥2+∥y^−z∥2\| \boldy - \boldz \|^2 = \| (\boldy - \hat \boldy) + (\hat \boldy - \boldz) \|^2 = \| \boldy - \hat \boldy \|^2 + \| \hat \boldy - \boldz \|^2

The second equality follows from y−y^⊥S\boldy - \hat \boldy \perp S (why?) and the Pythagorian law. Since z\boldz was an arbitrary point in SS, we have ∥y−z∥⩾∥y−y^∥\| \boldy - \boldz \| \geq \| \boldy - \hat \boldy \| for all z∈S\boldz \in S. Hence (2.9) holds.

Orthogonal projection

Figure 2.15:Orthogonal projection

2.2.3Projection as a Mapping

In view of theorem 2.2.1, for each fixed linear subspace SS in RN\RR^N, the operation

y  ↦ the orthogonal projection of y onto S\boldy \; \mapsto \text{ the orthogonal projection of } \boldy \text{ onto } S

is a well-defined function from RN\RR^N to RN\RR^N. The function is typically denoted by P\boldP. For each y∈RN\boldy \in \RR^N, the symbol Py\boldP \boldy represents the image of y\boldy under P\boldP, which is the orthogonal projection y^\hboldy. P\boldP is called the orthogonal projection onto SS, and we write

P=proj⁡S\boldP = \proj S

Figure 2.16 illustrates the action of P\boldP on two different vectors.

Orthogonal projection under \boldP

Figure 2.16:Orthogonal projection under P\boldP

Using this notation, we can restate the orthogonal projection theorem, as well as adding some properties of P\boldP:

These results are not difficult to prove, given theorem 2.2.1. Linearity of P\boldP is left as an exercise (ex. 2.4.29). Parts (ii)–(iii) follow directly from theorem 2.2.1. To see (iv), observe that y\boldy can be decomposed as y=Py+y−Py\boldy = \boldP \boldy + \boldy - \boldP \boldy. Now apply the Pythagorean law. Part (v) follows from part (iv). Part (vi) follows from the definition of Py\boldP \boldy as the closest point to y\boldy in SS. Part (vii) is an exercise.

Fact 2.2.6 is a fundamental result. It’s true because the right-hand side of (2.10) clearly lies in SS (being a linear combination of basis functions) and, for any uj\boldu_j in the basis set

⟨y−Py,uj⟩=⟨y,uj⟩−∑k=1K⟨y,uk⟩⟨uk,uj⟩=⟨y,uj⟩−⟨y,uj⟩=0\inner{\boldy - \boldP \boldy, \boldu_j} = \inner{\boldy, \boldu_j } - \sum_{k=1}^K \inner{\boldy, \boldu_k} \inner{\boldu_k, \boldu_j} = \inner{\boldy, \boldu_j} - \inner{\boldy, \boldu_j } = 0

This is enough to confirm that y−Py⊥S\boldy - \boldP \boldy \perp S (see ex. 2.4.14).

There’s one more essential property of P\boldP that we need to make note of: Suppose that we have two linear subspaces S1S_1 and S2S_2 of RN\RR^N, where S1⊂S2S_1 \subset S_2. What then is the difference between (1) first projecting a point onto the bigger subspace S2S_2, and then projecting the result onto the smaller subspace S1S_1, and (2) projecting directly to the smaller subspace S1S_1? The answer is none—we get the same result:

2.2.4The Residual Projection

Consider the setting of the orthogonal projection theorem. Our interest is in projecting y\boldy onto SS, where SS is a linear subspace of RN\RR^N. The closest point to y\boldy in SS is y^:=Py\hboldy := \boldP \boldy where P=proj⁡S\boldP = \proj S. Unless y\boldy was already in SS, some error y−Py\boldy - \boldP \boldy remains. Tracking and managing this residual will be important to us, so let’s introduce an operator M\boldM that takes y∈RN\boldy \in \RR^N and returns the residual. We can define it as

M:=I−P\boldM := \boldI - \boldP

where I\boldI is the identity mapping on RN\RR^N. For any y\boldy we have My=Iy−Py=y−Py\boldM \boldy = \boldI \boldy - \boldP \boldy = \boldy - \boldP \boldy as required. In regression analysis M\boldM shows up as a matrix called the “annihilator.” This is a pretty cool name, but it’s also not a great description of its function. In what follows we will refer to M\boldM as the residual projection.

Part (v) means that PMy=MPy=0\boldP \boldM \boldy = \boldM \boldP \boldy = \boldzero for all y∈RN\boldy \in \RR^N. Figure 2.17 illustrates the action of M\boldM. The results in fact 2.2.8 can be seen in the figure.

The residual projection

Figure 2.17:The residual projection

If S1S_1 and S2S_2 are two subspaces of RN\RR^N with S1⊂S2S_1 \subset S_2, then S2⊥⊂S1⊥S_2^{\perp} \subset S_1^{\perp}. This means that the result in fact 2.2.7 is reversed for M\boldM.

As an application of the ideas above, let’s now discuss a procedure called Gram–Schmidt orthogonalization, which provides a fundamental link between the two major concepts discussed in this chapter: linear independence and orthogonality. It can be considered as a partial converse to fact 2.2.2.

The proof of theorem 2.2.3 provides an important algorithm for generating the orthonormal set {u1,…,uK}\{\boldu_1, \ldots, \boldu_K\}. The first step is to construct orthogonal sets {v1,…,vk}\{\boldv_1, \ldots, \boldv_k\} with span identical to {b1,…,bk}\{\boldb_1, \ldots, \boldb_k\} for each kk. The construction of {v1,…,vK}\{\boldv_1, \ldots, \boldv_K\} uses the so called Gram–Schmidt orthogonalization procedure. First, for each k=1,…,Kk = 1, \ldots, K, let

  1. Bk:=span⁡{b1,…,bk}B_k := \Span\{\boldb_1, \ldots, \boldb_k\},

  2. Pk:=proj⁡Bk\boldP_k := \proj B_k and Mk:=proj⁡Bk⊥\boldM_k := \proj B_k^{\perp},

  3. vk:=Mk−1bk\boldv_k := \boldM_{k-1} \boldb_k where M0\boldM_0 is the identity mapping, and

  4. Vk:=span⁡{v1,…,vk}V_k := \Span\{\boldv_1, \ldots, \boldv_k\}.

In step (iii) we map each successive element bk\boldb_k into a subspace orthogonal to the subspace generated by b1,…,bk−1\boldb_1, \ldots, \boldb_{k-1}. In the exercises you are asked to show that {v1,…,vK}\{\boldv_1, \ldots, \boldv_K\} is an orthogonal set and Vk=BkV_k = B_k for all kk (ex. 2.4.34). To complete the argument, we introduce the vectors uk\boldu_k by uk:=vk/∥vk∥\boldu_k := \boldv_k / \| \boldv_k \| and confirm that this set of vectors {u1,…,uk}\{\boldu_1, \ldots, \boldu_k\} is orthonormal with span equal to VkV_k. These results are also (solved) exercises.

2.3Further Reading

Good texts on vector spaces include Marcus & Minc (1988) and Jänich (1994).

2.4Exercises

In the next three exercises, the notation is as given in theorem 2.2.3 and the discussion immediately afterwards.

2.4.1Solutions to Selected Exercises

Footnotes
  1. In some instances, the notion of scalar multiplication includes multiplication of vectors by complex numbers. In what follows we will work almost entirely with real scalars. Hence scalar multiplication means real scalar multiplication unless otherwise stated.

  2. AA is a proper subset of BB if A⊂BA \subset B and A≠BA \neq B.

  3. Hint: There’s no need to go taking derivatives and setting them equal to zero. An easier proof exists. If you’re stuck, consider the Cauchy–Schwarz inequality.

  4. Hint: Use the triangle inequality.

References
  1. Jänich, K. (1994). Linear Algebra. New York: Springer.
  2. Çinlar, E., & Vanderbei, R. J. (2013). Real and Convex Analysis. New York: Springer.
  3. Marcus, M., & Minc, H. (1988). Introduction to Linear Algebra. Mineola, NY: Dover Publications.