Docsity

Introduction and Vector Spaces - Lecture Notes | MATH 110, Study notes of Linear Algebra

Toggle sidebar
bg1
Linear Algebra
July 28, 2006
1 Introduction
These notes are intended for use in the warm-up camp for incoming Berkeley Statistics
graduate students. Welcome to Cal! We assume that you have taken a linear algebra course
before and that most of the material in these notes will be a review of what you already
know. If you have never taken such a course before, you are strongly encouraged to do so
by taking math 110 (or the honors version of it), or by covering material presented and/or
mentioned here on your own. If some of the material is unfamiliar, do not be intimidated!
We hope you find these notes helpful! If not, you can consult the references listed at the end,
or any other textbooks of your choice for more information or another style of presentation
(most of the proofs on linear algebra part have been adopted from Strang, the proof of F-test
from Montgomery et al, and the proof of bivariate normal density from Bickel and Doksum).
Go Bears!
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a

Partial preview of the text

Download Introduction and Vector Spaces - Lecture Notes | MATH 110 and more Study notes Linear Algebra in PDF only on Docsity!

Linear Algebra

July 28, 2006

1 Introduction

These notes are intended for use in the warm-up camp for incoming Berkeley Statistics graduate students. Welcome to Cal! We assume that you have taken a linear algebra course before and that most of the material in these notes will be a review of what you already know. If you have never taken such a course before, you are strongly encouraged to do so by taking math 110 (or the honors version of it), or by covering material presented and/or mentioned here on your own. If some of the material is unfamiliar, do not be intimidated! We hope you find these notes helpful! If not, you can consult the references listed at the end, or any other textbooks of your choice for more information or another style of presentation (most of the proofs on linear algebra part have been adopted from Strang, the proof of F-test from Montgomery et al, and the proof of bivariate normal density from Bickel and Doksum). Go Bears!

2 Vector Spaces

A set V is a vector space over R and its elements are called vectors if there are 2 opera- tions defined on it:

  1. Vector addition, that assigns to each pair of vectors v 1 , v 2 ∈ V another vector w ∈ V (we write v 1 + v 2 = w)
  2. Scalar multiplication, that assigns to each vector v ∈ V and each scalar r ∈ R another vector w ∈ V (we write rv = w)

that satisfy the following 8 conditions ∀ v 1 , v 2 , v 3 ∈ V and ∀ r 1 , r 2 ∈ R:

  1. v 1 + v 2 = v 2 + v 1
  2. (v 1 + v 2 ) + v 3 = v 1 + (v 2 + v 3 )
  3. ∃ vector 0 ∈ V , s.t. v + 0 = v, ∀ v ∈ V
  4. ∀ v ∈ V ∃ −v = w ∈ V s.t. v + w = 0
  5. r 1 (r 2 v) = (r 1 r 2 )v, ∀ v ∈ V
  6. (r 1 + r 2 )v = r 1 v + r 2 v, ∀ v ∈ V
  7. r(v 1 + v 2 ) = rv 1 + rv 2 , ∀ r ∈ R
  8. 1v = v, ∀ v ∈ V

2.1 Basic Concepts

We say that S ⊂ V is a subspace of V , if S is closed under vector addition and scalar multiplication, i.e.

  1. ∀s 1 , s 2 ∈ S, s 1 + s 2 ∈ S
  2. ∀s ∈ S, ∀r ∈ R, rs ∈ S

You can verify that if those conditions hold, S is a vector space in its own right (satisfies the 8 conditions above). Note also that S has to be non-empty, empty set is not allowed as a subspace. Examples:

  1. A subset { 0 } is always a subspace of a vectors space V
  2. Given vectors v 1 , v 2 ,... , vn ∈ V , the set of all their linear combinations (see below for definition) is a subspace of V.
  3. S = {(x, y) ∈ R^2 : y = 0} is a subspace of R^2 (x-axis)
  4. A set of all continuous functions defined on interval [− 1 , 1] is a subspace of F[− 1 ,1]

For all of the above examples, you should check for yourself that they are in fact subspaces. You can also verify for yourself that the 2 conditions are indpendent of each other, by coming up with 2 subsets of R^2 : one that is closed under addition and subtraction but NOT under

scalar multiplication, and one that is closed under scalar multiplication but NOT under ad- dition/subtraction.

Given vectors v 1 , v 2 ,... , vn ∈ V , we say that w ∈ V is a linear combination of v 1 , v 2 ,... , vn if for some r 1 , r 2 ,... , rn ∈ R, we have w = r 1 v 1 + r 2 v 2 +... + rnvn. If ev- ery vector in V is a linear combination of v 1 , v 2 ,... , vn, then we say that v 1 , v 2 ,... , vn span V. Given vectors v 1 , v 2 ,... , vn ∈ V we say that v 1 , v 2 ,... , vn are linearly independent if r 1 v 1 + r 2 v 2 +... + rnvn = 0 =⇒ r 1 = r 2 =... = rn = 0, i.e. the only linear combination of v 1 , v 2 ,... , vn that produces 0 vector is the trivial one. We say that v 1 , v 2 ,... , vn are linearly dependent otherwise. Now suppose that v 1 , v 2 ,... , vn span V and that, moreover, they are linearly independent. Then we say that the set {v 1 , v 2 ,... , vn} is a basis for V.

Theorem: Let {v 1 , v 2 ,... vn} be a basis for V , and let {w 1 , w 2 ,... , wm} be another basis for V. Then n = m.

Proof: Omitted, but can be found in any book on linear algebra.

  1. e 1 =

^ ,^ e^2 =

^ , and^ e^3 =

^ form the standard basis for^ R

(^3) , since every

vector

x 1 x 2 x 3

^ in^ R

(^3) can be written as x 1 e 1 + x 2 e 2 + x 3 e 3 , so the three vectors span R 3

and their linear independence is easy to show. In general, Rn^ has dimension n.

  1. Let dim(V ) = n, and let v 1 , v 2 ,... , vm ∈ V , s.t. m > n. Then v 1 , v 2 ,... , vm are linearly dependent.

2.2 Orthogonality

An inner product is a function f : V × V → R (which we denote by f (v 1 , v 2 ) =< v 1 , v 2 >), s.t. ∀ v, w, z ∈ V , and ∀r ∈ R:

  1. < v, w + rz > =< v, w > +r < v, z >
  2. < v, w >=< w, v >
  3. < v, v >≥ 0 and < v, v >= 0 iff v = 0

We note here that not all vector spaces have inner products defined on them, but we will only be dealing with the ones that do. Examples:

  1. Given 2 vectors x =

x 1 x 2 ... xn

and y =

y 1 y 2 ... yn

in Rn, we define their inner product x′y

=< x, y > = ∑^ n i=1^ xiyi. You can check yourself that the 3 properties above are satisfied, and the meaning of notation x′y will become clear from the next section.

  1. Given f, g ∈ F[− 1 ,1], we define < f, g >= ∫^ −^11 f (x)g(x)dx. Once again, verification that this is indeed an inner product is left as an exersise. We point out here the relationship in Rn^ between inner products and the length (or norm) of a vector. The length of a vector x = ‖x‖ = √x^21 + x^22 +... + x^2 n = √x′x′, or ‖x‖^2 = x′x.

We say that vectors v, w in V are orthogonal if < v, w >= 0. Notice that the zero vector is the only vector orthogonal to itself (why?). Examples:

  1. In Rn^ the notion of orthogonality agrees with our usual perception of it. If x is orthog- onal to y, then Pythagorean theorem tells us that ‖x‖^2 + ‖y‖^2 = ‖x − y‖^2. Expending this in terms of inner products we get: x′x + y′y = (x − y)′(x − y) = x′x − y′x − x′y + y′y or 2x′y = 0 and thus < x, y >= x′y = 0.

complement of T in V , if S contains ALL vectors orthogonal to vectors in T and we write S = T ⊥. For example, the x-axis and y-axis are orthogonal subspaces of R^3 , but they are

not orthogonal complements of each other, since y-axis does not contain

^ , which is

perpendicular to every vector in x-axis. However, y-z plane and x-axis ARE orthogonal complements of each other in R^3. You should prove as an exersise that if dim(V ) = n, and dim(S) = k, then dim(S⊥) = n − k.

2.3 Gram-Schmidt Process

Suppose we’re given linearly independent vectors v 1 , v 2 ,... , vn in V , and there’s inner product defined on V. Then we know that v 1 , v 2 ,... , vn form a basis for the subspace which they span (why?), and we can find an orthogonal basis for this subspace as follows. Let q 1 = v 1 Suppose v 2 is not orthogonal to v 1. then let rv 1 be the projection of v 2 on v 1 , i.e. we want to find r ∈ R s.t. q 2 = v 2 − rq 1 is orthogonal to q 1. Well, we should have < q 1 , (v 2 − rq 1 ) >= 0, and we get r = <q <q^11 ,v,q^21 >>. Notice that the span of q 1 , q 2 is the same as the span of v 1 , v 2 , since all we did was to subtract multiples of original vectors from other original vectors. Proceeding in similar fashion, we obtain qi = vi −^ ((^ <q <q 11 ,v,qi 1 >>^ ) q 1 +... +^ (^ <q<qi−i− 11 ,q,vi−i> 1 >^ ) qi− 1 ) , and we thus end up with an orthogonal basis for the subspace. If we furthermore divide each of the resulting vectors q 1 , q 2 ,... , qn by its length, we are left with orthonormal basis, i.e. < qi, qj >= 0 ∀i 6 = j and < qi, qi >= 1 ∀i (why?). We call these vectors that have length 1

unit vectors. As an exersise, you can now construct an orthonormal basis for the subspace of F[− 1 ,1] spanned by f (x) = 1, g(x) = x, and h(x) = x^2. An important point to take away is that given any basis for finite-dimensional V , if there’s an inner product defined on V , we can always turn the given basis into an orthonormal basis.

3 Matrices and Matrix Alegbra

An m × n matrix A is a rectangular array of numbers that has m rows and n columns, and we write:

A =

a 11 a 12... a 1 n a 21 a 22... a 2 n ......... ... am 1 am 2... amn

For the time being we’ll restrict ourselves to real matrices, so ∀ 1 ≤ i ≤ m and ∀ 1 ≤ j ≤ n,

aij ∈ R. Notice that a familiar vector x =

x 1 x 2 ... xn

∈ Rn^ is just a n × 1 matrix (we say x is

a column vector. A 1 × n matrix is referred to as a row vector. If m = n, we say that A is square.

of A (see below for definition of column space).

  1. Now, let A be m × n, and let x be a 1 × m row vector. Let a 1 , a 2 ,... , am denote rows of A, and x 1 , x 2 ,... , xm denote the components of x. Then multiplying A on the left by x, we obtain a 1 × n row vector xA = x 1 a 1 + x 2 a 2 +... + xmam, a linear combination of the rows of A. Thus multiplying matrix on the right by a row vector always returns a vector in the row space of A (see below for definition of row space)
  2. Now let A be m × n, and let B be n × k, and let a 1 , a 2 ,... , an denote columns of A and b 1 , b 2 ,... , bk denote the columns of B, and let cj denote the j-th column of m × k C = AB. Then cj = Abj = b 1 j a 1 + b 2 j a 2 +... + bnj an, i.e. we get the columns of product matrix by applying A to the columns of B. Notice that it also implies that every column of product matrix is a linear combination of columns of A.
  3. Once again, consider m × n A and n × k B, and let a 1 , a 2 ,... an denote rows of A (they are, of course, just 1 × n row vectors). Then letting ci denote the i-th row of C = AB, we have cj = aj B, i.e. we get the rows of the product matrix by applying rows of A to B. Notice, that it means that every row of C is a linear combination of rows of B.
  4. Finally, let A be m×n and B be n×k. Then if we let a 1 , a 2 ,... , an denote the columns of A and b 1 , b 2 ,... , bn denote the rows of B, then AB = a 1 b 1 + a 2 b 2 +... + anbn, the sum of n matrices, each of which is a product of a row and a column (check this for yourself!).

Let A be m × n, then we say that transpose of A is the n × m matrix A′, s.t. aij = a′ ji. Now the notation we used to define the inner product on Rn^ makes sense, since given two n × 1 column vectors x and y, their inner product < x, y > is just x′y according to matrix multiplication. Let In×n, denote the n × n identity matrix, i.e. the matrix that has 1’s down its main diagonal and 0’s everywhere else (in future we might omit the dimensional subscript and just write I, the dimension should always be clear from the context). You should check that in that case, In×nA = AIn×n = A for every n × n A. We say that n × n A, has n × n inverse, denoted A−^1 , if AA−^1 = A−^1 A = In×n. If A has inverse, we say that A is invertible. Not every matrix has inverse, as you can easily see by considering the n × n zero matrix. We will assume that you are familiar with the use of elimination to calculate inverses of invertible matrices and will not present this material. The following are some important results about inverses and transposes:

  1. (AB)′^ = B′A′
  2. If A is invertible and B is invertible, then AB is invertible, and (AB)−^1 = B−^1 A−^1
  3. If A is invertible, then (A−^1 )′^ = (A′)−^1
  4. A is invertible iff Ax = 0 =⇒ x = 0 (we say that N (A) = { 0 }, where N (A) is the nullspace of A, to be defined shortly).

You should prove all of these identities as an exersise.

3.3 Fundamental Spaces

Let A be m × n. We will denote by col(A) the subspace of Rm^ that is spanned by columns of A, and we’ll call this subspace column space of A. Similarly, we define the row space of A to be the subspace of Rn^ spanned by rows of A and we notice that it is precisely col(A′). Now, let N (A) = {x ∈ Rn^ : Ax = 0}. You should check for yourself that this set, which we call kernel or nullspace of A is indeed subspace of Rn. Similary we define the left nullspace of A, to be {x ∈ Rm^ : x′A = 0}, and we notice that this is precisely N (A′). The fundamental theorem of linear algebra states:

  1. dim(col(A)) = r = dim(col(A′)). Dimension of column space is the same as dimension of row space. This dimension is called rank of A.
  2. col(A) = (N (A′))⊥^ and N (A) = (col(A′))⊥. The columns space is the orthogonal complement of the left nullspace in Rm, and the nullspace is the orthogonal complement of the row space in Rn. We also conclude that dim(N (A)) = n − r, and dim(N (A′)) = m − r.

We will not present the proof of the theorem here, but we hope you are familiar with these results. If not, you should consider taking a course in linear algebra (math 110). We can see from the theorem, that the columns of A are linearly independent iff the nullspace doesnt’ contain any vector other than zero. Similarly, rows are linearly independent iff the left nullspace doesn’t contain any vector other than zero.

We now make some remarks about solving equations of the form Ax = b, where A is a m × n matrix, x is n × 1 vector, and b is m × 1 vector, and we are trying to solve for x. First of all, it should be clear at this point that if b /∈ col(A), then the solution doesn’t exist. If b ∈ col(A), but the columns of A are not linearly independent, then the solution will not be unique. That’s because there will be many ways to combine columns of A to produce b, resulting in many possible x’s. Another way to see this is to notice that if the columns are dependent, the nullspace contains some non-trivial vector x∗, and if x is some solution to Ax = b, then x + x∗^ is also a solution. Finally we notice that if r = m > n (i.e. if the rows are linearly independent), then the columns MUST span the whole Rm, and therefore a solution exists for every b (though it may not be unique). We conclude then, that if r = m, the solution to Ax = b always exists, and if r = n, the solution (if it exists) is unique. This leads us to conclude that if n = r = m (i.e. A is full-rank square matrix), the solution always exists and is unique. The proof based on elimination techniques (which you should be familiar with) then establishes that a square matrix A is full-rank iff it is invertible. You should be able now to prove the following results:

  1. rank(A′A) = rank(A). In particular, if rank(A) = n (columns are linearly independent), then A′A is invertible. Similarly, show that rank(AA′) = rank(A), and if the rows are linearly independent, AA′^ is invertible. (Hint: show that the nullspaces of the two matrices are the same).
  1. P is symmetric and idempotent (what should happen to a vector if you project it and then project it again?).
  2. I − P is the projection onto orthogonal complement of col(A) (i.e. the left nullspace of A)
  3. Given any vector b ∈ Rm^ and any subspace S of Rm, b can be written (uniquely) as the sum of its projections onto S and S⊥
  4. P (I − P ) = (I − P )P = 0 (what should happen to a vector when it’s first projected to S and then S⊥?)
  5. col(P ) = col(A)
  6. Every symmetric and idempotent matrix P is a projection. All we need to show if that when we apply P to a vector b, the remaining part of b is orthogonal to col(P ), so P projects onto its column space. Well, P ′(b − P b) = P ′(I − P )b = P (I − P )b = (P − P 2 )b = 0b = 0.
  7. Let a be a vector in Rm. Then a projection matrix onto the line through a is P = (^) ‖aaa‖′ 2 , and if a = q is a unit vector, then P = qq′.
  8. Combining the above result with the fact that we can always come up with an or- thonormal basis for Rm^ (Gram-Schmidt) and with the fact about splitting vector into

projections, we see that we can write b ∈ Rm^ as q 1 q 1 ′b + q 2 q′ 2 b +... + qmq m′b for some orthonormal basis {q 1 , q 2 ,... , qm}.

  1. tr(P ) = r.

4.2 Applications to Statistics

Suppose we have a linear model, where we model some response as Yi = xi 1 β 1 + xi 2 β 2 +

... + xipβp + i, where xi 1 , xi 2 ,... , xip are the values of explanatory variables for observation i, i is the error term for observaion i that has an expected value of 0, and β 1 , β 2 ,... , βp are the coefficients we’re interested in estimating. Suppose we have n > p observations. Then writing the above system in matrix notation we have Y = Xβ + , where X is the n × p matrix of explanatory variables, Y and  are n × 1 vectors of observations and errors respectively, and p × 1 β is what we’re interested in. We will furthermore assume that the columns of X are linearly independent. Since we don’t actually observe the values of the error terms, we can’t determine the value of β and have to estimate it. One estimator of β that has some nice properties (which you will learn about in statistics lectures of this camp) is βˆ that minimizes ∑^ n i=1^ (yi^ −^ xiβ)

(^2) , where xi

is the i-th row of X. We recognize that in matrix notation βˆ minimizes (Y − Xβ)′(Y − Xβ). From this point there are two (or more ways) that we can arrive at the same conclusion. First, we could recognize that the same βˆ has to minimize ‖Y − Xβ‖ (since the expresison above was just ‖Y − Xβ‖^2 , and ‖Y − Xβ‖ is always non-negative), and therefore we pick